github.com/codefresh-io/kcfi@v0.0.0-20230301195427-c1578715cc46/charts/external-nodes/templates/register-node-pod.yaml (about)

     1  apiVersion: v1
     2  kind: Pod
     3  metadata:
     4    name: cf-node-registar-{{ randAlphaNum 5 | lower }}
     5    labels:
     6      app: cf-node-registar
     7  spec:
     8    restartPolicy: Never
     9    containers:
    10    - name: register
    11      image: "{{ .Values.nodeRegistarJob.dockerRegistry | default "docker.io" }}/{{ .Values.nodeRegistarJob.image }}:{{ .Values.nodeRegistarJob.imageTag | default "latest" }}"
    12      command:
    13        - bash
    14        - -c
    15        - |
    16          FAILURE=
    17          BASE_DIR=/tmp/codefresh
    18          mkdir -pv ${BASE_DIR}
    19          cp -rLv /opt/mounts/* ${BASE_DIR}/
    20          chmod +x ${BASE_DIR}/scripts/*.sh
    21          ${BASE_DIR}/scripts/register-all-nodes.sh
    22          if [[ $? != 0 ]]; then
    23            FAILURE+="One or more register nodes have been FAILED; "
    24          fi
    25          ${BASE_DIR}/scripts/deploy-all-re.sh
    26          if [[ $? != 0 ]]; then
    27            FAILURE+="one or more deploy runtime environments have been FAILED"
    28          fi
    29          if [[ -n "${FAILURE}" ]]; then
    30            echo "FAILURE: $FAILURE"
    31            exit 1
    32          fi
    33          # sleep 3600
    34      volumeMounts:
    35      - name: scripts
    36        mountPath: /opt/mounts/scripts
    37      - name: nodes-config
    38        mountPath: /opt/mounts/nodes
    39      - name: runtime-environments-config
    40        mountPath: /opt/mounts/runtime-environments
    41    volumes:
    42    - name: scripts
    43      configMap:
    44        name: cf-node-registar-scripts
    45    - name: nodes-config
    46      configMap:
    47        name: cf-node-registar-nodes
    48    - name: runtime-environments-config
    49      configMap:
    50        name: cf-node-registar-runtime-environments