How does Kubernetes simplify containerized application deployment process?

0 votes
Could somebody illustrate with an example how kubernetes simplifies the process of containerized application deployment.
Jul 11 in Kubernetes by Sam
• 1,070 points
155 views

1 answer to this question.

0 votes

A application deployment requires , web tier , application tier and database tier . All these requirements will spawn multiple containers and these containers should communicate among each other . Kubernetes cluster will take care of the whole system and orchestrates the container needs . 

Let us look at a quick WordPress application example

WordPress application consists of frontend(WordPress running on PHP and Apache) and backend(MySQL). 

The below YAML file can help you specify everything you will need to bring WordPress Application in a single shot:

apiVersion: v1
kind: Service
metadata:
 name: wordpress
 labels:
   app: wordpress
spec:
 ports:
   - port: 80
 selector:
   app: wordpress
   tier: frontend
 type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
 name: wp-pv-claim
 labels:
   app: wordpress
spec:
 storageClassName: manual
 accessModes:
   - ReadWriteOnce
 resources:
   requests:
     storage: 2Gi
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
 name: wordpress
 labels:
   app: wordpress
spec:
 storageClassName: manual
 selector:
   matchLabels:
     app: wordpress
     tier: frontend
 strategy:
   type: Recreate
 template:
   metadata:
     labels:
       app: wordpress
       tier: frontend
   spec:
     containers:
 - image: wordpress:4.8-apache
       name: wordpress
       env:
       - name: WORDPRESS_DB_HOST
         value: wordpress-mysql
       - name: WORDPRESS_DB_PASSWORD
         valueFrom:
           secretKeyRef:
             name: mysql-pass
             key: password
       ports:
       - containerPort: 80
         name: wordpress
       volumeMounts:
       - name: wordpress-persistent-storage
         mountPath: /var/www/html
     volumes:
     - name: wordpress-persistent-storage
       persistentVolumeClaim:
         claimName: wp-pv-clai

I assume that you have n-node Kubernetes cluster running in your infrastructure. All you need is to run the below command:

kubectl create -f wordpress-deployment.yaml   

That’s it.

Browse to http://<IP>:80 port to open to see WordPress App up and running. Hence, we saw that how Kubernetes simplifies the application deployment.

answered Jul 11 by Sirajul
• 5,960 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,240 points
253 views
0 votes
1 answer

How can I access a service installed on Kubernetes from anywhere?

I have followed the link which you have ...READ MORE

answered Jul 23, 2018 in Kubernetes by Atul
• 10,240 points
98 views
0 votes
1 answer
0 votes
1 answer

Kubernetes Dashboard v1.8.3 deployment

You’ve created your ServiceAccount on a different ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 37,320 points
136 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
1,134 views
+3 votes
1 answer
0 votes
1 answer

How does DNS work in kubernetes?

DNS is a built-in service in Kubernetes. ...READ MORE

answered Jul 12 in Kubernetes by Sirajul
• 5,960 points
15 views
0 votes
1 answer

how to package a kubernetes application?

Helm is a package manager which allows users ...READ MORE

answered 2 days ago in Kubernetes by Sirajul
• 5,960 points
15 views