# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "regulation.fullname" . }}-regulation
  labels:
  {{- include "regulation.labels" . | nindent 4 }}
data:
  ABILITY_LIGHTNING_BARTENDER: {{ .Values.regulation.abilityLightningBartender |
    quote }}
  ANTLER_LOUNGE: {{ .Values.regulation.antlerLounge | quote }}
  CORRESPONDENT_SCISSORS_DAMAGED: {{ .Values.regulation.correspondentScissorsDamaged
    | quote }}
  EPHEMERA_LUMBERMAN_RAWHIDE: {{ .Values.regulation.ephemeraLumbermanRawhide | quote
    }}
  POP: {{ .Values.regulation.pop | quote }}
  RIVULET: {{ .Values.regulation.rivulet | quote }}
  TERMINAL_SMELLY_ROOMMATE: {{ .Values.regulation.terminalSmellyRoommate | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "regulation.fullname" . }}-regulation
  labels:
  {{- include "regulation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: regulation
spec:
  replicas: {{ .Values.regulation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: regulation
      app.kubernetes.io/name: skate
    {{- include "regulation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: regulation
        app.kubernetes.io/name: skate
      {{- include "regulation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ba96b465af1a6231bf08f87a9b70870c10e8fd82d611154cf93cd44d0e014243
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "regulation.fullname" . }}-regulation
        image: {{ .Values.regulation.regulation.image.repository }}:{{ .Values.regulation.regulation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.regulation.regulation.imagePullPolicy }}
        name: regulation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.regulation.regulation.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.regulation.regulation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "regulation.fullname" . }}-regulation
  labels:
  {{- include "regulation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.regulation.type }}
  selector:
    app.kubernetes.io/instance: regulation
    app.kubernetes.io/name: skate
  {{- include "regulation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.regulation.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
regulation:
  abilityLightningBartender: transom
  antlerLounge: defense
  correspondentScissorsDamaged: pork
  ephemeraLumbermanRawhide: size
  pop: cloakroom
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  regulation:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  rivulet: min
  terminalSmellyRoommate: undertake
  type: ClusterIP
