github.com/replicatedcom/ship@v0.50.0/integration/init/istio/expected/base/charts/security/templates/Job-istio-cleanup-secrets.yaml (about)

     1  apiVersion: batch/v1
     2  kind: Job
     3  metadata:
     4    name: istio-cleanup-secrets
     5    namespace: default
     6    annotations:
     7      "helm.sh/hook": post-delete
     8      "helm.sh/hook-delete-policy": hook-succeeded
     9      "helm.sh/hook-weight": "3"
    10    labels:
    11      app: security
    12      chart: security
    13      heritage: Tiller
    14      release: istio
    15  spec:
    16    template:
    17      metadata:
    18        name: istio-cleanup-secrets
    19        labels:
    20          app: security
    21          chart: security
    22          heritage: Tiller
    23          release: istio
    24          version: 1.1.0
    25      spec:
    26        serviceAccountName: istio-cleanup-secrets-service-account
    27        containers:
    28          - name: kubectl
    29            image: "gcr.io/istio-release/kubectl:master-latest-daily"
    30            imagePullPolicy: IfNotPresent
    31            command:
    32            - /bin/bash
    33            - -c
    34            - >
    35                kubectl get secret --all-namespaces | grep "istio.io/key-and-cert" |  while read -r entry; do
    36                  ns=$(echo $entry | awk '{print $1}');
    37                  name=$(echo $entry | awk '{print $2}');
    38                  kubectl delete secret $name -n $ns;
    39                done
    40        restartPolicy: OnFailure