github.com/replicatedcom/ship@v0.50.0/integration/unfork/istio-k8s/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-1.0.3
    13      release: istio
    14      heritage: Tiller
    15  spec:
    16    template:
    17      metadata:
    18        name: istio-cleanup-secrets
    19        labels:
    20          app: security
    21          release: istio
    22      spec:
    23        serviceAccountName: istio-cleanup-secrets-service-account
    24        containers:
    25          - name: hyperkube
    26            image: "quay.io/coreos/hyperkube:v1.7.6_coreos.0"
    27            command:
    28            - /bin/bash
    29            - -c
    30            - >
    31                kubectl get secret --all-namespaces | grep "istio.io/key-and-cert" |  while read -r entry; do
    32                  ns=$(echo $entry | awk '{print $1}');
    33                  name=$(echo $entry | awk '{print $2}');
    34                  kubectl delete secret $name -n $ns;
    35                done
    36        restartPolicy: OnFailure