k8s集群v1.15.xx和v1.18.xx编排文件区别

k8s集群v1.15.xx和v1.18.xx编排文件区别

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

给TA打赏
共{{data.count}}人
人已打赏
k8s编排文件

k8s部署centos-busybox编排文件

2021-4-29 14:02:50

k8s编排文件

k8s集群v1.15.xx改v1.18.xx编排文件命令

2021-4-29 14:32:15

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索