k8s集群v1.15.xx升级v1.18.xx后编排文件有区别,对比方便参考
版本
|
k8s v1.15.xx
|
k8sv1.18.xx
|
---|---|---|
编排文件 | apiVersion: extensions/v1beta1 kind: Deployment metadata: name: test-http-selinux1 namespace: default spec: replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: name: test-http-selinux1 app: test-http-selinux1 version: v1 spec: containers: – name: test-http-selinux1 image: hub.selinux.cn/test/http-selinux1:v1 command : [“./testdemo”] args: [“-e”, “test”] ports: – containerPort: 50011 resources: limits: cpu: 2000m memory: 1Gi nodeSelector: type: test-node —apiVersion: v1 kind: Service metadata: name: test-http-selinux1 namespace: default spec: type: NodePort ports: – name: http-selinux1 port: 50011 protocol: TCP nodePort: 30111 selector: name: test-http-selinux1 |
apiVersion: apps/v1 kind: Deployment metadata: name: test-http-selinux1 namespace: default spec: selector: matchLabels: app: test-http-selinux1 replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: name: test-http-selinux1 app: test-http-selinux1 version: v1 spec: containers: – name: test-http-selinux1 image: hub.selinux.cn/test/http-selinux1:v1 command : [“./testdemo”] args: [“-e”, “test”] ports: – containerPort: 50011 resources: limits: cpu: 2000m memory: 1Gi nodeSelector: type: test-node —apiVersion: v1 kind: Service metadata: name: test-http-selinux1 namespace: default spec: type: NodePort ports: – name: http-selinux1 port: 50011 protocol: TCP nodePort: 30111 selector: app: test-http-selinux1 |
v1.15.xx编排文件
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: test-http-selinux1 namespace: default spec: replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: name: test-http-selinux1 app: test-http-selinux1 version: v1 spec: containers: - name: test-http-selinux1 image: hub.selinux.cn/test/http-selinux1:v1 command : ["./testdemo"] args: ["-e", "test"] ports: - containerPort: 50011 resources: limits: cpu: 2000m memory: 1Gi nodeSelector: type: test-node --- apiVersion: v1 kind: Service metadata: name: test-http-selinux1 namespace: default spec: type: NodePort ports: - name: http-selinux1 port: 50011 protocol: TCP nodePort: 30111 selector: name: test-http-selinux1
v1.18.xx编排文件
apiVersion: apps/v1 kind: Deployment metadata: name: test-http-selinux1 namespace: default spec: selector: matchLabels: app: test-http-selinux1 replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: name: test-http-selinux1 app: test-http-selinux1 version: v1 spec: containers: - name: test-http-selinux1 image: hub.selinux.cn/test/http-selinux1:v1 command : ["./testdemo"] args: ["-e", "test"] ports: - containerPort: 50011 resources: limits: cpu: 2000m memory: 1Gi nodeSelector: type: test-node --- apiVersion: v1 kind: Service metadata: name: test-http-selinux1 namespace: default spec: type: NodePort ports: - name: http-selinux1 port: 50011 protocol: TCP nodePort: 30111 selector: app: test-http-selinux1