github.com/wangchanggan/helm@v0.0.0-20211020154240-11b1b7d5406d/docs/examples/nginx/templates/deployment.yaml (about)

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