github.com/lrills/helm@v2.8.1+incompatible/docs/examples/nginx/templates/post-install-job.yaml (about)

     1  apiVersion: batch/v1
     2  kind: Job
     3  metadata:
     4    name: {{ template "nginx.fullname" . }}
     5    labels:
     6      # The "heritage" label is used to track which tool deployed a given chart.
     7      # It is useful for admins who want to see what releases a particular tool
     8      # is responsible for.
     9      heritage: {{ .Release.Service }}
    10      # The "release" convention makes it easy to tie a release to all of the
    11      # Kubernetes resources that were created as part of that release.
    12      release: {{ .Release.Name }}
    13      # This makes it easy to audit chart usage.
    14      chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    15      app: {{ template "nginx.name" . }}
    16    annotations:
    17      # This is what defines this resource as a hook. Without this line, the
    18      # job is considered part of the release.
    19      "helm.sh/hook": post-install
    20  spec:
    21    template:
    22      metadata:
    23        name: {{ template "nginx.fullname" . }}
    24        labels:
    25          release: {{ .Release.Name }}
    26          app: {{ template "nginx.name" . }}
    27      spec:
    28        # This shows how to use a simple value. This will look for a passed-in value
    29        # called restartPolicy. If it is not found, it will use the default value.
    30        # {{ default "Never" .restartPolicy }} is a slightly optimized version of the
    31        # more conventional syntax: {{ .restartPolicy | default "Never" }}
    32        restartPolicy: {{ .Values.restartPolicy }}
    33        containers:
    34          - name: post-install-job
    35            image: "alpine:3.3"
    36            # All we're going to do is sleep for a while, then exit.
    37            command: ["/bin/sleep", "{{ .Values.sleepyTime }}"]