# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "begonia.fullname" . }}-begonia
  labels:
  {{- include "begonia.labels" . | nindent 4 }}
data:
  IMPROPRIETY: {{ .Values.begonia.impropriety | quote }}
  LACKADAISICAL: {{ .Values.begonia.lackadaisical | quote }}
  MODELING_FRAME_BOUDOIR: {{ .Values.begonia.modelingFrameBoudoir | quote }}
  RINSE_TRIAL_CROTCH: {{ .Values.begonia.rinseTrialCrotch | quote }}
  SLAP_TRACT_BEG: {{ .Values.begonia.slapTractBeg | quote }}
  WARRANT_CONSENSUS: {{ .Values.begonia.warrantConsensus | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "begonia.fullname" . }}-begonia
  labels:
  {{- include "begonia.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: begonia
spec:
  replicas: {{ .Values.begonia.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: begonia
      app.kubernetes.io/name: mobster
    {{- include "begonia.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: begonia
        app.kubernetes.io/name: mobster
      {{- include "begonia.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3b0e8f598814e5927927e6620d3d0f3bacd9bafabd752ef398c40508af56cff0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "begonia.fullname" . }}-begonia
        image: {{ .Values.begonia.begonia.image.repository }}:{{ .Values.begonia.begonia.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.begonia.begonia.imagePullPolicy }}
        name: begonia
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.begonia.begonia.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.begonia.begonia.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "begonia.fullname" . }}-begonia
  labels:
  {{- include "begonia.labels" . | nindent 4 }}
spec:
  type: {{ .Values.begonia.type }}
  selector:
    app.kubernetes.io/instance: begonia
    app.kubernetes.io/name: mobster
  {{- include "begonia.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.begonia.ports | toYaml | nindent 2 -}}
begonia:
  begonia:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  impropriety: completion
  lackadaisical: piglet
  modelingFrameBoudoir: hippodrome
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rinseTrialCrotch: secrecy
  slapTractBeg: sand
  type: ClusterIP
  warrantConsensus: puritan
kubernetesClusterDomain: cluster.local
