# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "puffy.fullname" . }}-puffy
  labels:
  {{- include "puffy.labels" . | nindent 4 }}
data:
  DORY_TRUST_SWANLING: {{ .Values.puffy.doryTrustSwanling | quote }}
  HIP_PHARMACOPOEIA_FACILITATE: {{ .Values.puffy.hipPharmacopoeiaFacilitate | quote
    }}
  TINTYPE_FLYTRAP: {{ .Values.puffy.tintypeFlytrap | quote }}
  TORTE: {{ .Values.puffy.torte | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "puffy.fullname" . }}-puffy
  labels:
  {{- include "puffy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: puffy
spec:
  replicas: {{ .Values.puffy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: puffy
      app.kubernetes.io/name: mansard
    {{- include "puffy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: puffy
        app.kubernetes.io/name: mansard
      {{- include "puffy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 665a66404fd5a4f780d4081c786609ab9d2af8663b19fbac3c9d322f586beea4
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "puffy.fullname" . }}-puffy
        image: {{ .Values.puffy.puffy.image.repository }}:{{ .Values.puffy.puffy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.puffy.puffy.imagePullPolicy }}
        name: puffy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.puffy.puffy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.puffy.puffy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "puffy.fullname" . }}-puffy
  labels:
  {{- include "puffy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.puffy.type }}
  selector:
    app.kubernetes.io/instance: puffy
    app.kubernetes.io/name: mansard
  {{- include "puffy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.puffy.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
puffy:
  doryTrustSwanling: puma
  hipPharmacopoeiaFacilitate: rectangle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  puffy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  tintypeFlytrap: panoramic
  torte: luncheonette
  type: ClusterIP
