stillprogressive.blogg.se

Getting started with docker and kubernetes
Getting started with docker and kubernetes













  1. GETTING STARTED WITH DOCKER AND KUBERNETES PDF
  2. GETTING STARTED WITH DOCKER AND KUBERNETES INSTALL
  3. GETTING STARTED WITH DOCKER AND KUBERNETES SOFTWARE
  4. GETTING STARTED WITH DOCKER AND KUBERNETES CODE

You now have four replicas of your application, each running independently on the cluster with the load balancer you created earlier and serving traffic to all of them. If you run out of resources you could always add more nodes to the deployment kubectl scale deployment hello-node -replicas =4 Hello-node 10.3.246.12 23.251.159.72 8080/TCP 2mĬheck to check if its working Using Kubernetes to scale up

getting started with docker and kubernetes

NAME CLUSTER_IP EXTERNAL_IP PORT (S ) AGE To view the external ip kubectl get services hello-node To access the pod from outside the network you have to expose it as a kubernetes service kubectl expose deployment hello-node -type = "LoadBalancer" NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGEīy default the pod can be accessed only by internal traffic. Deployments are the way of managing, creating and scaling pods. Now lets deploy the container gcloud container clusters get-credentials hello-world Load balancing with KubernetesĪ pod is a group of containers kubectl run hello-node -image =gcr.io/ $PROJECT_ID/hello-node:v1 -port =8080

getting started with docker and kubernetes

Gcloud container clusters create hello-world Set google cloud project zone gcloud config set compute/zone us-central1-a You can use this image with Kubernetes Setting Kubernetes cluster You should now bee able to see your image in the container registry This is a private repository for your docker images gcloud docker push gcr.io/ $PROJECT_ID/hello-node:v1 Now lets push our container to Google container registry. To stop the running container execute the below command docker stop hello_tutorial To check what docker containers are running execute Now run below command to build the docker imageĭocker build -t gcr.io/ $PROJECT_ID/hello-node:v1ĭocker run -d -p 8080:8080 -name hello_tutorial gcr.io/ $PROJECT_ID/hello-node:v1 Docker build builds images automatically by reading the instructions of DockerFile FROM node: 4. Now we have created our application, lets create a docker image from it.Ĭreate a file named DockerFile also within hellonodeĭockerFile is a text file which contains all the commands in order which is needed to build an image. Open your browser and navigate to You should see text “Welcome to Docker!”

GETTING STARTED WITH DOCKER AND KUBERNETES INSTALL

Then run below command to install kubectl gcloud components install kubectl Create an application and build a docker imageĬreate a folder named hellonode and within it create a file server.js var http = require ( 'http' ) var handleRequest = function ( request, response ) var listen ( 8080 )

getting started with docker and kubernetes

If you don’t already have done, download and install node.js from here Lets create a simple node.js application and create a docker image of it. NOTE: Google provides free $300 trial and below steps would only costs few dollars from it. Make sure you have enabled billing in the cloud console so you could use its resources. Set an environment variable as below export PROJECT_ID = "your-project-id" You will see the project ID below the text box you type your project name, copy and save it somewhere Sign in to google cloud platform console from hereĬreate a New project and give it a name eg: sampleKubernetesApp Simple tutorial with Docker and Kubernetes Prerequisites

GETTING STARTED WITH DOCKER AND KUBERNETES SOFTWARE

Google donated its software to Cloud Native Computing Foundation thus it evolved in to Kubernetes. This concept originated from google and Kubernetes is a descendent of the google cluster management system Borg.

getting started with docker and kubernetes

Kubernetes is an open source cluster management software for containers.

GETTING STARTED WITH DOCKER AND KUBERNETES PDF

If the program is like a word file then the docker image of that program would be PDF document of that word file.

GETTING STARTED WITH DOCKER AND KUBERNETES CODE

Docker is basically a tool or a piece of software designed to create, deploy and run applications using containers.Ī docker image contains code, runtime, system tools, system libraries so you could be sure that your code would behave the same regardless of the environment it runs.















Getting started with docker and kubernetes