# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "energetic.fullname" . }}-energetic
  labels:
  {{- include "energetic.labels" . | nindent 4 }}
data:
  CHARGE: {{ .Values.energetic.charge | quote }}
  EMINENT_HOURGLASS_FLARE: {{ .Values.energetic.eminentHourglassFlare | quote }}
  GAZE_MISOGYNY_CUPCAKE: {{ .Values.energetic.gazeMisogynyCupcake | quote }}
  RIDING_MORTALITY_AWFUL: {{ .Values.energetic.ridingMortalityAwful | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "energetic.fullname" . }}-energetic
  labels:
  {{- include "energetic.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: energetic
spec:
  replicas: {{ .Values.energetic.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: energetic
      app.kubernetes.io/name: scow
    {{- include "energetic.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: energetic
        app.kubernetes.io/name: scow
      {{- include "energetic.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f0b9b448874ddb630f405b42f1edd30717771ec55ec84dab4a9ec38ade7293cb
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "energetic.fullname" . }}-energetic
        image: {{ .Values.energetic.energetic.image.repository }}:{{ .Values.energetic.energetic.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.energetic.energetic.imagePullPolicy }}
        name: energetic
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.energetic.energetic.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.energetic.energetic.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "energetic.fullname" . }}-energetic
  labels:
  {{- include "energetic.labels" . | nindent 4 }}
spec:
  type: {{ .Values.energetic.type }}
  selector:
    app.kubernetes.io/instance: energetic
    app.kubernetes.io/name: scow
  {{- include "energetic.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.energetic.ports | toYaml | nindent 2 -}}
energetic:
  charge: boxer
  eminentHourglassFlare: bike
  energetic:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  gazeMisogynyCupcake: rosemary
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  ridingMortalityAwful: lottery
  type: ClusterIP
kubernetesClusterDomain: cluster.local
