# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "shirtdress.fullname" . }}-shirtdress
  labels:
  {{- include "shirtdress.labels" . | nindent 4 }}
data:
  PRECEDENCE_LATTER_TAILSPIN: {{ .Values.shirtdress.precedenceLatterTailspin | quote
    }}
  REBELLION: {{ .Values.shirtdress.rebellion | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "shirtdress.fullname" . }}-shirtdress
  labels:
  {{- include "shirtdress.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: shirtdress
spec:
  replicas: {{ .Values.shirtdress.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: shirtdress
      app.kubernetes.io/name: dazzling
    {{- include "shirtdress.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: shirtdress
        app.kubernetes.io/name: dazzling
      {{- include "shirtdress.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a6a090b73246a3fa15c3d95c6ac7ad23778b435e7496586518828c91b1f74cf8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "shirtdress.fullname" . }}-shirtdress
        image: {{ .Values.shirtdress.shirtdress.image.repository }}:{{ .Values.shirtdress.shirtdress.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.shirtdress.shirtdress.imagePullPolicy }}
        name: shirtdress
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.shirtdress.shirtdress.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.shirtdress.shirtdress.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "shirtdress.fullname" . }}-shirtdress
  labels:
  {{- include "shirtdress.labels" . | nindent 4 }}
spec:
  type: {{ .Values.shirtdress.type }}
  selector:
    app.kubernetes.io/instance: shirtdress
    app.kubernetes.io/name: dazzling
  {{- include "shirtdress.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.shirtdress.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
shirtdress:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  precedenceLatterTailspin: demon
  rebellion: carpet
  replicas: 1
  shirtdress:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
