github.com/lrills/helm@v2.8.1+incompatible/docs/examples/nginx/templates/deployment.yaml (about)

     1  apiVersion: extensions/v1beta1
     2  kind: Deployment
     3  metadata:
     4    # This uses a "fullname" template (see _helpers)
     5    # Basing names on .Release.Name means that the same chart can be installed
     6    # multiple times into the same namespace.
     7    name: {{ template "nginx.fullname" . }}
     8    labels:
     9      # The "heritage" label is used to track which tool deployed a given chart.
    10      # It is useful for admins who want to see what releases a particular tool
    11      # is responsible for.
    12      heritage: {{ .Release.Service }}
    13      # The "release" convention makes it easy to tie a release to all of the
    14      # Kubernetes resources that were created as part of that release.
    15      release: {{ .Release.Name }}
    16      # This makes it easy to audit chart usage.
    17      chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    18      app: {{ template "nginx.name" . }}
    19  spec:
    20    replicas: {{ .Values.replicaCount }}
    21    template:
    22      metadata:
    23  {{- if .Values.podAnnotations }}
    24        # Allows custom annotations to be specified
    25        annotations:
    26  {{ toYaml .Values.podAnnotations | indent 8 }}
    27  {{- end }}
    28        labels:
    29          app: {{ template "nginx.name" . }}
    30          release: {{ .Release.Name }}
    31      spec:
    32        containers:
    33          - name: {{ template "nginx.name" . }}
    34            image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
    35            imagePullPolicy: {{ .Values.image.pullPolicy }}
    36            ports:
    37              - name: http
    38                containerPort: 80
    39                protocol: TCP
    40            # This (and the volumes section below) mount the config map as a volume.
    41            volumeMounts:
    42              - mountPath: /usr/share/nginx/html
    43                name: wwwdata-volume
    44            resources:
    45  # Allow chart users to specify resources. Usually, no default should be set, so this is left to be a conscious
    46  # choice to the chart users and avoids that charts don't run out of the box on, e. g., Minikube when high resource
    47  # requests are specified by default.
    48  {{ toYaml .Values.resources | indent 12 }}
    49      {{- if .Values.nodeSelector }}
    50        nodeSelector:
    51        # Node selectors can be important on mixed Windows/Linux clusters.
    52  {{ toYaml .Values.nodeSelector | indent 8 }}
    53      {{- end }}
    54        volumes:
    55          - name: wwwdata-volume
    56            configMap:
    57              name: {{ template "nginx.fullname" . }}