Kubernetes Deployment for App Deployment

Deploy Applications with Kubernetes Deployments
How to Deploy Apps Using Kubernetes Deployments
Tasks
- Create a deployment named - httpd.
- Deploy the application - httpd.
- Use the image - httpd:latest(make sure to specify the tag).
Steps
- Make yaml file or you can try EOF. Personally I like using EOF. (Alternatively, you can try vim/ nano anything. - cat > httpd-deployment.yaml <<EOF apiVersion: apps/v1 kind: Deployment metadata: name: httpd spec: replicas: 1 selector: matchLabels: app: httpd template: metadata: labels: app: httpd spec: containers: - name: httpd-container image: httpd:latest EOF 
- Now apply the yaml file - kubectl apply -f httpd-deployment.yaml 
- Apply the deployment with the following command: - kubectl apply -f httpd-deployment.yaml 
- To check if the deployment is created, run: - kubectl get deployments 
- To make sure to specify the tag (latest) - As we already have deployment named - httpd.
 
    kubectl describe deployment httpd
#k8s #devops #deployments #happylearning