1 2 3 4 5 6 7 8 9 10 11 12 13 | apiVersion: v1 kind: Pod metadata: labels: run: test-multi-container name: test-multi-container spec: containers: - image: nginx name: main-container - image: nginx name: sub-container | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | apiVersion: v1 kind: Pod metadata: labels: run: test-init-container name: test-init-container spec: containers: - image: nginx name: main command: ["/bin/sh"] args: ["-c", "echo main container success!!!"] initContainers: - image: nginx name: init command: ["/bin/sh"] args: ["-c", "echo init container success!!!"] | cs |