# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mini-skirt.fullname" . }}-mini-skirt
  labels:
  {{- include "mini-skirt.labels" . | nindent 4 }}
data:
  DISILLUSIONED_DISCOVER_STRENGTHEN: {{ .Values.miniSkirt.disillusionedDiscoverStrengthen
    | quote }}
  FEATURE: {{ .Values.miniSkirt.feature | quote }}
  QUESTION_TERMINATION: {{ .Values.miniSkirt.questionTermination | quote }}
  SILVER_ERROR: {{ .Values.miniSkirt.silverError | quote }}
  WILLOW_COLLEGE: {{ .Values.miniSkirt.willowCollege | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "mini-skirt.fullname" . }}-mini-skirt
  labels:
  {{- include "mini-skirt.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: mini-skirt
spec:
  replicas: {{ .Values.miniSkirt.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: mini-skirt
      app.kubernetes.io/name: answer
    {{- include "mini-skirt.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: mini-skirt
        app.kubernetes.io/name: answer
      {{- include "mini-skirt.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1e66cc531548e7e60e5cdd7b696155addc4176b1bee8ddc177f8cab896601445
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "mini-skirt.fullname" . }}-mini-skirt
        image: {{ .Values.miniSkirt.miniSkirt.image.repository }}:{{ .Values.miniSkirt.miniSkirt.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.miniSkirt.miniSkirt.imagePullPolicy }}
        name: mini-skirt
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.miniSkirt.miniSkirt.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.miniSkirt.miniSkirt.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "mini-skirt.fullname" . }}-mini-skirt
  labels:
  {{- include "mini-skirt.labels" . | nindent 4 }}
spec:
  type: {{ .Values.miniSkirt.type }}
  selector:
    app.kubernetes.io/instance: mini-skirt
    app.kubernetes.io/name: answer
  {{- include "mini-skirt.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.miniSkirt.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
miniSkirt:
  disillusionedDiscoverStrengthen: migrant
  feature: advice
  miniSkirt:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  questionTermination: fruit
  replicas: 1
  silverError: thinking
  type: ClusterIP
  willowCollege: mighty
