# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "butler.fullname" . }}-butler
  labels:
  {{- include "butler.labels" . | nindent 4 }}
data:
  DEAL_DESERT: {{ .Values.butler.dealDesert | quote }}
  DISTORTION_BIOSPHERE: {{ .Values.butler.distortionBiosphere | quote }}
  HARD_APPLICATION_RAVIOLI: {{ .Values.butler.hardApplicationRavioli | quote }}
  HIGHWAY_FEATURE: {{ .Values.butler.highwayFeature | quote }}
  MINK_DESCRIBE_LAWYER: {{ .Values.butler.minkDescribeLawyer | quote }}
  PLOT_LYCRA: {{ .Values.butler.plotLycra | quote }}
  ROOMY: {{ .Values.butler.roomy | quote }}
  SERIAL_HAPPY: {{ .Values.butler.serialHappy | quote }}
  SOLIDITY: {{ .Values.butler.solidity | quote }}
  SPINACH_PROCEDURE_THEISM: {{ .Values.butler.spinachProcedureTheism | quote }}
  SURVIVAL_SOLIDARITY_ICICLE: {{ .Values.butler.survivalSolidarityIcicle | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "butler.fullname" . }}-butler
  labels:
  {{- include "butler.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: butler
spec:
  replicas: {{ .Values.butler.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: butler
      app.kubernetes.io/name: port
    {{- include "butler.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: butler
        app.kubernetes.io/name: port
      {{- include "butler.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 65058587fa4fc70977b75267905c63edf970541ac4e2066dc672831a6db0febe
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "butler.fullname" . }}-butler
        image: {{ .Values.butler.butler.image.repository }}:{{ .Values.butler.butler.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.butler.butler.imagePullPolicy }}
        name: butler
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.butler.butler.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.butler.butler.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "butler.fullname" . }}-butler
  labels:
  {{- include "butler.labels" . | nindent 4 }}
spec:
  type: {{ .Values.butler.type }}
  selector:
    app.kubernetes.io/instance: butler
    app.kubernetes.io/name: port
  {{- include "butler.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.butler.ports | toYaml | nindent 2 -}}
butler:
  butler:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dealDesert: id
  distortionBiosphere: cashier
  hardApplicationRavioli: baseline
  highwayFeature: record
  minkDescribeLawyer: cupboard
  plotLycra: soggy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  roomy: convert
  serialHappy: palace
  solidity: reinscription
  spinachProcedureTheism: ribbon
  survivalSolidarityIcicle: belligerent
  type: ClusterIP
kubernetesClusterDomain: cluster.local
