![what is kubernetes deployment what is kubernetes deployment](https://s7280.pcdn.co/wp-content/uploads/2020/11/Openshift.png)
#What is kubernetes deployment how to#
They just go together really nicely! How to delete a deployment in Kubernetes You can use services independent of deployments. You can use deployments independent of services. A service is employed to permit network access to a collection of pods.īoth services and deployments will choose which pods they operate on using labels and label selectors.
![what is kubernetes deployment what is kubernetes deployment](https://miro.medium.com/max/1200/1*I6GE8zsfJQ0Fv6UXwjJmaw.png)
What’s the distinction between a Deployment and a service? A Deployment is employed to stay a collection of pods running by making pods from a model. labels: deploy: example spec: containers: - name: nginx image: nginx:1.7.9 Deployment vs service # This is used in the deployment selector. Which pods are managed by this deployment? selector: # This must match the labels we set on the pod! matchLabels: deploy: example # This template field is a regular pod configuration # nested inside the deployment spec template: metadata: # Set labels on the pod. How do want to update the pods? strategy: Recreate # 3. How many copies of each pod do we want? replicas: 3 # 2. kind: Deployment apiVersion: extensions/v1beta1 metadata: name: nginx-deployment spec: # A deployment's specification really only # has a few useful options # 1. In this case, the deployments can produce pods that run Nginx-hostname and with the designed labels. (You will ignore the extra comments regarding the “service” here - this readying was taken from a distinct example that conjointly incorporated services.) First, the replicas key sets the number of instances of the pod that the readying ought to keep alive.