# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bikini.fullname" . }}-bikini
  labels:
  {{- include "bikini.labels" . | nindent 4 }}
data:
  FROSTING: {{ .Values.bikini.frosting | quote }}
  IGNORANCE_PLATYPUS: {{ .Values.bikini.ignorancePlatypus | quote }}
  RESOURCE_WIRETAP_FLECK: {{ .Values.bikini.resourceWiretapFleck | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bikini.fullname" . }}-bikini
  labels:
  {{- include "bikini.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bikini
spec:
  replicas: {{ .Values.bikini.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bikini
      app.kubernetes.io/name: admit
    {{- include "bikini.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bikini
        app.kubernetes.io/name: admit
      {{- include "bikini.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ba80293656e264721b7b2c550cf4b76af620cd4dc960ff27eee1937225592216
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bikini.fullname" . }}-bikini
        image: {{ .Values.bikini.bikini.image.repository }}:{{ .Values.bikini.bikini.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bikini.bikini.imagePullPolicy }}
        name: bikini
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bikini.bikini.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bikini.bikini.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bikini.fullname" . }}-bikini
  labels:
  {{- include "bikini.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bikini.type }}
  selector:
    app.kubernetes.io/instance: bikini
    app.kubernetes.io/name: admit
  {{- include "bikini.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bikini.ports | toYaml | nindent 2 -}}
bikini:
  bikini:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  frosting: tights
  ignorancePlatypus: shortwave
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  resourceWiretapFleck: bracelet
  type: ClusterIP
kubernetesClusterDomain: cluster.local
