mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #45447 from gyliu513/init-container
Automatic merge from submit-queue Put initContainers to PodSpec for some statefulset examples. **What this PR does / why we need it**: Fixed https://github.com/kubernetes/kubernetes/issues/45405 The `init container` is [graduated to GA](https://github.com/kubernetes/kubernetes/pull/38382) , so some test YAML templates needs to be updated to not use `annotations`. The following are the two places that needs update: 1. [cockroachdb](https://github.com/kubernetes/kubernetes/blob/master/examples/cockroachdb/cockroachdb-statefulset.yaml) 2. [e2e statefulset test](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/testing-manifests/statefulset) **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
		@@ -77,46 +77,33 @@ spec:
 | 
				
			|||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: cockroachdb
 | 
					        app: cockroachdb
 | 
				
			||||||
      annotations:
 | 
					 | 
				
			||||||
        # Init containers are run only once in the lifetime of a pod, before
 | 
					 | 
				
			||||||
        # it's started up for the first time. It has to exit successfully
 | 
					 | 
				
			||||||
        # before the pod's main containers are allowed to start.
 | 
					 | 
				
			||||||
        # This particular init container does a DNS lookup for other pods in
 | 
					 | 
				
			||||||
        # the set to help determine whether or not a cluster already exists.
 | 
					 | 
				
			||||||
        # If any other pods exist, it creates a file in the cockroach-data
 | 
					 | 
				
			||||||
        # directory to pass that information along to the primary container that
 | 
					 | 
				
			||||||
        # has to decide what command-line flags to use when starting CockroachDB.
 | 
					 | 
				
			||||||
        # This only matters when a pod's persistent volume is empty - if it has
 | 
					 | 
				
			||||||
        # data from a previous execution, that data will always be used.
 | 
					 | 
				
			||||||
        pod.alpha.kubernetes.io/init-containers: '[
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "bootstrap",
 | 
					 | 
				
			||||||
                "image": "cockroachdb/cockroach-k8s-init:0.1",
 | 
					 | 
				
			||||||
                "imagePullPolicy": "IfNotPresent",
 | 
					 | 
				
			||||||
                "args": [
 | 
					 | 
				
			||||||
                  "-on-start=/on-start.sh",
 | 
					 | 
				
			||||||
                  "-service=cockroachdb"
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "env": [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      "name": "POD_NAMESPACE",
 | 
					 | 
				
			||||||
                      "valueFrom": {
 | 
					 | 
				
			||||||
                          "fieldRef": {
 | 
					 | 
				
			||||||
                              "apiVersion": "v1",
 | 
					 | 
				
			||||||
                              "fieldPath": "metadata.namespace"
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                   }
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "datadir",
 | 
					 | 
				
			||||||
                        "mountPath": "/cockroach/cockroach-data"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]'
 | 
					 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
 | 
					      # Init containers are run only once in the lifetime of a pod, before
 | 
				
			||||||
 | 
					      # it's started up for the first time. It has to exit successfully
 | 
				
			||||||
 | 
					      # before the pod's main containers are allowed to start.
 | 
				
			||||||
 | 
					      # This particular init container does a DNS lookup for other pods in
 | 
				
			||||||
 | 
					      # the set to help determine whether or not a cluster already exists.
 | 
				
			||||||
 | 
					      # If any other pods exist, it creates a file in the cockroach-data
 | 
				
			||||||
 | 
					      # directory to pass that information along to the primary container that
 | 
				
			||||||
 | 
					      # has to decide what command-line flags to use when starting CockroachDB.
 | 
				
			||||||
 | 
					      # This only matters when a pod's persistent volume is empty - if it has
 | 
				
			||||||
 | 
					      # data from a previous execution, that data will always be used.
 | 
				
			||||||
 | 
					      initContainers:
 | 
				
			||||||
 | 
					      - name: bootstrap
 | 
				
			||||||
 | 
					        image: cockroachdb/cockroach-k8s-init:0.1
 | 
				
			||||||
 | 
					        imagePullPolicy: IfNotPresent
 | 
				
			||||||
 | 
					        args:
 | 
				
			||||||
 | 
					          - "-on-start=/on-start.sh"
 | 
				
			||||||
 | 
					          - "-service=cockroachdb"
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          - name: POD_NAMESPACE
 | 
				
			||||||
 | 
					            valueFrom:
 | 
				
			||||||
 | 
					              fieldRef:
 | 
				
			||||||
 | 
					                apiVersion: v1
 | 
				
			||||||
 | 
					                fieldPath: metadata.namespace
 | 
				
			||||||
 | 
					       volumeMounts:
 | 
				
			||||||
 | 
					       - name: datadir
 | 
				
			||||||
 | 
					         mountPath: "/cockroach/cockroach-data"
 | 
				
			||||||
      affinity:
 | 
					      affinity:
 | 
				
			||||||
        podAntiAffinity:
 | 
					        podAntiAffinity:
 | 
				
			||||||
          preferredDuringSchedulingIgnoredDuringExecution:
 | 
					          preferredDuringSchedulingIgnoredDuringExecution:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,45 +9,32 @@ spec:
 | 
				
			|||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: cockroachdb
 | 
					        app: cockroachdb
 | 
				
			||||||
      annotations:
 | 
					 | 
				
			||||||
        # Init containers are run only once in the lifetime of a pod, before
 | 
					 | 
				
			||||||
        # it's started up for the first time. It has to exit successfully
 | 
					 | 
				
			||||||
        # before the pod's main containers are allowed to start.
 | 
					 | 
				
			||||||
        # This particular init container does a DNS lookup for other pods in
 | 
					 | 
				
			||||||
        # the set to help determine whether or not a cluster already exists.
 | 
					 | 
				
			||||||
        # If any other pods exist, it creates a file in the cockroach-data
 | 
					 | 
				
			||||||
        # directory to pass that information along to the primary container that
 | 
					 | 
				
			||||||
        # has to decide what command-line flags to use when starting CockroachDB.
 | 
					 | 
				
			||||||
        # This only matters when a pod's persistent volume is empty - if it has
 | 
					 | 
				
			||||||
        # data from a previous execution, that data will always be used.
 | 
					 | 
				
			||||||
        pod.alpha.kubernetes.io/init-containers: '[
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "bootstrap",
 | 
					 | 
				
			||||||
                "image": "cockroachdb/cockroach-k8s-init:0.1",
 | 
					 | 
				
			||||||
                "args": [
 | 
					 | 
				
			||||||
                  "-on-start=/on-start.sh",
 | 
					 | 
				
			||||||
                  "-service=cockroachdb"
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "env": [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      "name": "POD_NAMESPACE",
 | 
					 | 
				
			||||||
                      "valueFrom": {
 | 
					 | 
				
			||||||
                          "fieldRef": {
 | 
					 | 
				
			||||||
                              "apiVersion": "v1",
 | 
					 | 
				
			||||||
                              "fieldPath": "metadata.namespace"
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                   }
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "datadir",
 | 
					 | 
				
			||||||
                        "mountPath": "/cockroach/cockroach-data"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]'
 | 
					 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
 | 
					      # Init containers are run only once in the lifetime of a pod, before
 | 
				
			||||||
 | 
					      # it's started up for the first time. It has to exit successfully
 | 
				
			||||||
 | 
					      # before the pod's main containers are allowed to start.
 | 
				
			||||||
 | 
					      # This particular init container does a DNS lookup for other pods in
 | 
				
			||||||
 | 
					      # the set to help determine whether or not a cluster already exists.
 | 
				
			||||||
 | 
					      # If any other pods exist, it creates a file in the cockroach-data
 | 
				
			||||||
 | 
					      # directory to pass that information along to the primary container that
 | 
				
			||||||
 | 
					      # has to decide what command-line flags to use when starting CockroachDB.
 | 
				
			||||||
 | 
					      # This only matters when a pod's persistent volume is empty - if it has
 | 
				
			||||||
 | 
					      # data from a previous execution, that data will always be used.
 | 
				
			||||||
 | 
					      initContainers:
 | 
				
			||||||
 | 
					      - name: bootstrap
 | 
				
			||||||
 | 
					        image: cockroachdb/cockroach-k8s-init:0.1
 | 
				
			||||||
 | 
					        args:
 | 
				
			||||||
 | 
					        - "-on-start=/on-start.sh"
 | 
				
			||||||
 | 
					        - "-service=cockroachdb"
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					        - name: POD_NAMESPACE
 | 
				
			||||||
 | 
					          valueFrom:
 | 
				
			||||||
 | 
					            fieldRef:
 | 
				
			||||||
 | 
					              apiVersion: v1
 | 
				
			||||||
 | 
					              fieldPath: metadata.namespace
 | 
				
			||||||
 | 
					        volumeMounts:
 | 
				
			||||||
 | 
					        - name: datadir
 | 
				
			||||||
 | 
					          mountPath: "/cockroach/cockroach-data"
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - name: cockroachdb
 | 
					      - name: cockroachdb
 | 
				
			||||||
        # Runs the master branch. Not recommended for production, but since
 | 
					        # Runs the master branch. Not recommended for production, but since
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,53 +9,36 @@ spec:
 | 
				
			|||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: mysql
 | 
					        app: mysql
 | 
				
			||||||
      annotations:
 | 
					 | 
				
			||||||
        pod.alpha.kubernetes.io/init-containers: '[
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "install",
 | 
					 | 
				
			||||||
                "image": "gcr.io/google_containers/galera-install:0.1",
 | 
					 | 
				
			||||||
                "imagePullPolicy": "Always",
 | 
					 | 
				
			||||||
                "args": ["--work-dir=/work-dir"],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "config",
 | 
					 | 
				
			||||||
                        "mountPath": "/etc/mysql"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "bootstrap",
 | 
					 | 
				
			||||||
                "image": "debian:jessie",
 | 
					 | 
				
			||||||
                "command": ["/work-dir/peer-finder"],
 | 
					 | 
				
			||||||
                "args": ["-on-start=\"/work-dir/on-start.sh\"", "-service=galera"],
 | 
					 | 
				
			||||||
                "env": [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      "name": "POD_NAMESPACE",
 | 
					 | 
				
			||||||
                      "valueFrom": {
 | 
					 | 
				
			||||||
                          "fieldRef": {
 | 
					 | 
				
			||||||
                              "apiVersion": "v1",
 | 
					 | 
				
			||||||
                              "fieldPath": "metadata.namespace"
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                   }
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "config",
 | 
					 | 
				
			||||||
                        "mountPath": "/etc/mysql"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]'
 | 
					 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
 | 
					      initContainers:
 | 
				
			||||||
 | 
					      - name: install
 | 
				
			||||||
 | 
					        image: gcr.io/google_containers/galera-install:0.1
 | 
				
			||||||
 | 
					        imagePullPolicy: Always
 | 
				
			||||||
 | 
					        args:
 | 
				
			||||||
 | 
					        - "--work-dir=/work-dir"
 | 
				
			||||||
 | 
					        volumeMounts:
 | 
				
			||||||
 | 
					        - name: workdir
 | 
				
			||||||
 | 
					          mountPath: "/work-dir"
 | 
				
			||||||
 | 
					        - name: config
 | 
				
			||||||
 | 
					          mountPath: "/etc/mysql"
 | 
				
			||||||
 | 
					     - name: bootstrap
 | 
				
			||||||
 | 
					       image: debian:jessie
 | 
				
			||||||
 | 
					       command:
 | 
				
			||||||
 | 
					       - "/work-dir/peer-finder"
 | 
				
			||||||
 | 
					       args:
 | 
				
			||||||
 | 
					       - -on-start="/work-dir/on-start.sh"
 | 
				
			||||||
 | 
					       - "-service=galera"
 | 
				
			||||||
 | 
					       env:
 | 
				
			||||||
 | 
					       - name: POD_NAMESPACE
 | 
				
			||||||
 | 
					         valueFrom:
 | 
				
			||||||
 | 
					           fieldRef:
 | 
				
			||||||
 | 
					             apiVersion: v1
 | 
				
			||||||
 | 
					             fieldPath: metadata.namespace
 | 
				
			||||||
 | 
					       volumeMounts:
 | 
				
			||||||
 | 
					       - name: workdir
 | 
				
			||||||
 | 
					         mountPath: "/work-dir"
 | 
				
			||||||
 | 
					       - name: config
 | 
				
			||||||
 | 
					         mountPath: "/etc/mysql"
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - name: mysql
 | 
					      - name: mysql
 | 
				
			||||||
        image: gcr.io/google_containers/mysql-galera:e2e
 | 
					        image: gcr.io/google_containers/mysql-galera:e2e
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,53 +9,37 @@ spec:
 | 
				
			|||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: redis
 | 
					        app: redis
 | 
				
			||||||
      annotations:
 | 
					 | 
				
			||||||
        pod.alpha.kubernetes.io/init-containers: '[
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "install",
 | 
					 | 
				
			||||||
                "image": "gcr.io/google_containers/redis-install-3.2.0:e2e",
 | 
					 | 
				
			||||||
                "imagePullPolicy": "Always",
 | 
					 | 
				
			||||||
                "args": ["--install-into=/opt", "--work-dir=/work-dir"],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "opt",
 | 
					 | 
				
			||||||
                        "mountPath": "/opt"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "bootstrap",
 | 
					 | 
				
			||||||
                "image": "debian:jessie",
 | 
					 | 
				
			||||||
                "command": ["/work-dir/peer-finder"],
 | 
					 | 
				
			||||||
                "args": ["-on-start=\"/work-dir/on-start.sh\"", "-service=redis"],
 | 
					 | 
				
			||||||
                "env": [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      "name": "POD_NAMESPACE",
 | 
					 | 
				
			||||||
                      "valueFrom": {
 | 
					 | 
				
			||||||
                          "fieldRef": {
 | 
					 | 
				
			||||||
                              "apiVersion": "v1",
 | 
					 | 
				
			||||||
                              "fieldPath": "metadata.namespace"
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                   }
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "opt",
 | 
					 | 
				
			||||||
                        "mountPath": "/opt"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]'
 | 
					 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
 | 
					      initContainers:
 | 
				
			||||||
 | 
					      - name: install
 | 
				
			||||||
 | 
					        image: gcr.io/google_containers/redis-install-3.2.0:e2e
 | 
				
			||||||
 | 
					        imagePullPolicy: Always
 | 
				
			||||||
 | 
					        args:
 | 
				
			||||||
 | 
					        - "--install-into=/opt"
 | 
				
			||||||
 | 
					        - "--work-dir=/work-dir"
 | 
				
			||||||
 | 
					        volumeMounts:
 | 
				
			||||||
 | 
					        - name: opt
 | 
				
			||||||
 | 
					          mountPath: "/opt"
 | 
				
			||||||
 | 
					        - name: workdir
 | 
				
			||||||
 | 
					          mountPath: "/work-dir"
 | 
				
			||||||
 | 
					     - name: bootstrap
 | 
				
			||||||
 | 
					       image: debian:jessie
 | 
				
			||||||
 | 
					       command:
 | 
				
			||||||
 | 
					       - "/work-dir/peer-finder"
 | 
				
			||||||
 | 
					       args:
 | 
				
			||||||
 | 
					       - -on-start="/work-dir/on-start.sh"
 | 
				
			||||||
 | 
					       - "-service=redis"
 | 
				
			||||||
 | 
					       env:
 | 
				
			||||||
 | 
					       - name: POD_NAMESPACE
 | 
				
			||||||
 | 
					         valueFrom:
 | 
				
			||||||
 | 
					           fieldRef:
 | 
				
			||||||
 | 
					             apiVersion: v1
 | 
				
			||||||
 | 
					             fieldPath: metadata.namespace
 | 
				
			||||||
 | 
					       volumeMounts:
 | 
				
			||||||
 | 
					       - name: opt
 | 
				
			||||||
 | 
					         mountPath: "/opt"
 | 
				
			||||||
 | 
					       - name: workdir
 | 
				
			||||||
 | 
					         mountPath: "/work-dir"
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - name: redis
 | 
					      - name: redis
 | 
				
			||||||
        image: debian:jessie
 | 
					        image: debian:jessie
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,57 +9,39 @@ spec:
 | 
				
			|||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: zk
 | 
					        app: zk
 | 
				
			||||||
      annotations:
 | 
					 | 
				
			||||||
        pod.alpha.kubernetes.io/init-containers: '[
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "install",
 | 
					 | 
				
			||||||
                "image": "gcr.io/google_containers/zookeeper-install-3.5.0-alpha:e2e",
 | 
					 | 
				
			||||||
                "imagePullPolicy": "Always",
 | 
					 | 
				
			||||||
                "args": ["--install-into=/opt", "--work-dir=/work-dir"],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "opt",
 | 
					 | 
				
			||||||
                        "mountPath": "/opt/"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "name": "bootstrap",
 | 
					 | 
				
			||||||
                "image": "java:openjdk-8-jre",
 | 
					 | 
				
			||||||
                "command": ["/work-dir/peer-finder"],
 | 
					 | 
				
			||||||
                "args": ["-on-start=\"/work-dir/on-start.sh\"", "-service=zk"],
 | 
					 | 
				
			||||||
                "env": [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      "name": "POD_NAMESPACE",
 | 
					 | 
				
			||||||
                      "valueFrom": {
 | 
					 | 
				
			||||||
                          "fieldRef": {
 | 
					 | 
				
			||||||
                              "apiVersion": "v1",
 | 
					 | 
				
			||||||
                              "fieldPath": "metadata.namespace"
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                   }
 | 
					 | 
				
			||||||
                ],
 | 
					 | 
				
			||||||
                "volumeMounts": [
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "opt",
 | 
					 | 
				
			||||||
                        "mountPath": "/opt"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "workdir",
 | 
					 | 
				
			||||||
                        "mountPath": "/work-dir"
 | 
					 | 
				
			||||||
                    },
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        "name": "datadir",
 | 
					 | 
				
			||||||
                        "mountPath": "/tmp/zookeeper"
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ]'
 | 
					 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
 | 
					      initContainers:
 | 
				
			||||||
 | 
					      - name: install
 | 
				
			||||||
 | 
					        image: gcr.io/google_containers/zookeeper-install-3.5.0-alpha:e2e
 | 
				
			||||||
 | 
					        imagePullPolicy: Always
 | 
				
			||||||
 | 
					        args:
 | 
				
			||||||
 | 
					        - "--install-into=/opt"
 | 
				
			||||||
 | 
					        - "--work-dir=/work-dir"
 | 
				
			||||||
 | 
					        volumeMounts:
 | 
				
			||||||
 | 
					        - name: opt
 | 
				
			||||||
 | 
					          mountPath: "/opt/"
 | 
				
			||||||
 | 
					        - name: workdir
 | 
				
			||||||
 | 
					          mountPath: "/work-dir"
 | 
				
			||||||
 | 
					     - name: bootstrap
 | 
				
			||||||
 | 
					       image: java:openjdk-8-jre
 | 
				
			||||||
 | 
					       command:
 | 
				
			||||||
 | 
					       - "/work-dir/peer-finder"
 | 
				
			||||||
 | 
					       args:
 | 
				
			||||||
 | 
					       - -on-start="/work-dir/on-start.sh"
 | 
				
			||||||
 | 
					       - "-service=zk"
 | 
				
			||||||
 | 
					       env:
 | 
				
			||||||
 | 
					       - name: POD_NAMESPACE
 | 
				
			||||||
 | 
					         valueFrom:
 | 
				
			||||||
 | 
					           fieldRef:
 | 
				
			||||||
 | 
					             apiVersion: v1
 | 
				
			||||||
 | 
					             fieldPath: metadata.namespace
 | 
				
			||||||
 | 
					      volumeMounts:
 | 
				
			||||||
 | 
					      - name: opt
 | 
				
			||||||
 | 
					        mountPath: "/opt"
 | 
				
			||||||
 | 
					      - name: workdir
 | 
				
			||||||
 | 
					        mountPath: "/work-dir"
 | 
				
			||||||
 | 
					      - name: datadir
 | 
				
			||||||
 | 
					        mountPath: "/tmp/zookeeper"
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - name: zk
 | 
					      - name: zk
 | 
				
			||||||
        image: java:openjdk-8-jre
 | 
					        image: java:openjdk-8-jre
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user