# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rutabaga.fullname" . }}-rutabaga
  labels:
  {{- include "rutabaga.labels" . | nindent 4 }}
data:
  AMUSEMENT_RESTRUCTURE_CAMPER: {{ .Values.rutabaga.amusementRestructureCamper |
    quote }}
  AUTHENTICATION: {{ .Values.rutabaga.authentication | quote }}
  CHEDDAR: {{ .Values.rutabaga.cheddar | quote }}
  EVALUATOR: {{ .Values.rutabaga.evaluator | quote }}
  GEEK: {{ .Values.rutabaga.geek | quote }}
  HARPOONER_BUGGY: {{ .Values.rutabaga.harpoonerBuggy | quote }}
  QUEEN: {{ .Values.rutabaga.queen | quote }}
  SELECTION: {{ .Values.rutabaga.selection | quote }}
  SOUL_POSTBOX: {{ .Values.rutabaga.soulPostbox | quote }}
  SPITE_KITSCH: {{ .Values.rutabaga.spiteKitsch | quote }}
  STRIDE_WITHDRAWAL_ASTRONOMY: {{ .Values.rutabaga.strideWithdrawalAstronomy | quote
    }}
  TURRET: {{ .Values.rutabaga.turret | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rutabaga.fullname" . }}-rutabaga
  labels:
  {{- include "rutabaga.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rutabaga
spec:
  replicas: {{ .Values.rutabaga.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rutabaga
      app.kubernetes.io/name: great-grandmother
    {{- include "rutabaga.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rutabaga
        app.kubernetes.io/name: great-grandmother
      {{- include "rutabaga.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9ca605dc161d26d363041a6395c92f66f686feaa75271ac499b5e3195464149c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rutabaga.fullname" . }}-rutabaga
        image: {{ .Values.rutabaga.rutabaga.image.repository }}:{{ .Values.rutabaga.rutabaga.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rutabaga.rutabaga.imagePullPolicy }}
        name: rutabaga
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rutabaga.rutabaga.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rutabaga.rutabaga.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rutabaga.fullname" . }}-rutabaga
  labels:
  {{- include "rutabaga.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rutabaga.type }}
  selector:
    app.kubernetes.io/instance: rutabaga
    app.kubernetes.io/name: great-grandmother
  {{- include "rutabaga.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rutabaga.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rutabaga:
  amusementRestructureCamper: satire
  authentication: cuckoo
  cheddar: jewelry
  evaluator: upper
  geek: muddy
  harpoonerBuggy: speculation
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  queen: mighty
  replicas: 1
  rutabaga:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  selection: cruel
  soulPostbox: pimp
  spiteKitsch: nexus
  strideWithdrawalAstronomy: knowing
  turret: opponent
  type: ClusterIP
