# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "slippery.fullname" . }}-slippery
  labels:
  {{- include "slippery.labels" . | nindent 4 }}
data:
  CROSS-CONTAMINATION_BIDDING_INNOCENCE: {{ .Values.slippery.crossContaminationBiddingInnocence
    | quote }}
  GOOD_TITLE: {{ .Values.slippery.goodTitle | quote }}
  NATURALISATION_BRA_ROCKET-SHIP: {{ .Values.slippery.naturalisationBraRocketShip
    | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "slippery.fullname" . }}-slippery
  labels:
  {{- include "slippery.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: slippery
spec:
  replicas: {{ .Values.slippery.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: slippery
      app.kubernetes.io/name: waist
    {{- include "slippery.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: slippery
        app.kubernetes.io/name: waist
      {{- include "slippery.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0db0bd537c0c674c073e5498feb37df9f551776ee0f9fa300c19e44af8fc864a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "slippery.fullname" . }}-slippery
        image: {{ .Values.slippery.slippery.image.repository }}:{{ .Values.slippery.slippery.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.slippery.slippery.imagePullPolicy }}
        name: slippery
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.slippery.slippery.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.slippery.slippery.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "slippery.fullname" . }}-slippery
  labels:
  {{- include "slippery.labels" . | nindent 4 }}
spec:
  type: {{ .Values.slippery.type }}
  selector:
    app.kubernetes.io/instance: slippery
    app.kubernetes.io/name: waist
  {{- include "slippery.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.slippery.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
slippery:
  crossContaminationBiddingInnocence: silver
  goodTitle: heart
  naturalisationBraRocketShip: stiletto
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  slippery:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
