What is the difference between a pod and a deployment?

后端 未结 8 536
一向
一向 2020-11-30 16:56

I have been creating pods with type:deployment but I see that some documentation uses type:pod, more specifically the documentation for multi-conta

8条回答
  •  独厮守ぢ
    2020-11-30 17:23

    Pod is container instance.

    That is the output of replicas: 3

    Think of one deployment can have many running instances(replica).

    //deployment.yaml
    apiVersion: apps/v1beta2
    kind: Deployment
    metadata:
      name: tomcat-deployment222
    spec:
      selector:
        matchLabels:
          app: tomcat
      replicas: 3
      template:
        metadata:
          labels:
            app: tomcat
        spec:
          containers:
          - name: tomcat
            image: tomcat:9.0
            ports:
            - containerPort: 8080
    

提交回复
热议问题