k8s资源sidecar

sidecar 模式

共享 不共享
network ipc
utc pid
mount user
apiVersion: v1
kind: Pod
metadata:
  name: test-sidecar
  namespace: default
spec:
  hostname: test-sidecar    # 主机名
  volumes:                  # 存储
  - name: test-volume    
    hostPath:
      path: /tmp
  containers:
    - name: test1
      image: python
      imagePullPolicy: IfNotPresent
      args:
      - "python"
      - "-m"
      - "http.server"
      - "8111"
      ports:
      - containerPort: 8111
      volumeMounts:
        - name: test-volume
          mountPath: /tmp/123
    - name: test2
      image: python
      imagePullPolicy: IfNotPresent
      args:
      - "python"
      - "-m"
      - "http.server"
      - "8112"
      ports:
      - containerPort: 8112
      volumeMounts:
        - name: test-volume
          mountPath: /tmp/123                                             
上一篇:docker-compose和Dockerfile的volumes


下一篇:圆柱体体积