centos-pod

apiVersion: v1
kind: Pod
metadata:
  name: my-centos
  labels:
    app: centos
spec:
  containers:
  - name: my-centos
    image: centos:6.8
    imagePullPolicy: IfNotPresent
    command: ["top","-b"]

centos-rc

$ cat centos-rc.yaml 
apiVersion: v1
kind: ReplicationController
metadata:
  name: rc-centos
spec:
  replicas: 1
  selector:
    app: centos
  template:
    metadata:
      labels:
        app: centos
    spec:
      containers:
      - name: app-centos
        image: centos:6.8
        imagePullPolicy: IfNotPresent
        command: ["top","-b"]

 centos-deploy

$ cat centos-deploy.yaml 
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: deploy-centos
spec:
  replicas: 1
  selector:
    matchLabels:
      app: centos
  template:
    metadata:
      labels:
        app: centos
    spec:
      containers:
      - name: app-centos
        image: centos
        imagePullPolicy: IfNotPresent  
        command: ["top", "-b"]
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐