deployment 示例

apiVersion: apps/v1
kind: Deployment
metadata:
  name: php7-2
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: php7-2
      release: test
  template:
    metadata:
      labels:
        app: php7-2
        release: test
    spec:
      containers:
      - name: php7-2
        image: 192.168.0.189:5000/php:58-7.2
        ports:
        - name: php
          containerPort: 9000

将一个deployment导出成yaml文件
kubectl get deployment php7-2 -o yaml --export

你可能感兴趣的:(deployment 示例)