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, 2019 in Kubernetes by Sam
• 6,260 points
1,241 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, 2019 by Sirajul
• 59,230 points

Related Questions In Kubernetes

0 votes
1 answer

Kubernetes: How do i initiate rollback for an application ?

Rollback and rolling updates are a feature ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
3,374 views
0 votes
1 answer

How do I determine the status of a Deployment? - Kubernetes

Use kubectl get deployment <deployment>. If the ...READ MORE

answered Jul 25, 2019 in Kubernetes by Harsha
495 views
0 votes
1 answer

How to create deployment build in kubernetes?

Hi@akhtar, To create any resources in kubernetes you ...READ MORE

answered May 18, 2020 in Kubernetes by MD
• 95,440 points
717 views
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,300 points
2,227 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
14,610 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,095 views
0 votes
1 answer

How does DNS work in kubernetes?

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

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,230 points
1,081 views
0 votes
1 answer

how to package a kubernetes application?

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

answered Jul 17, 2019 in Kubernetes by Sirajul
• 59,230 points
735 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP