# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "used.fullname" . }}-used
  labels:
  {{- include "used.labels" . | nindent 4 }}
data:
  BREAK_FRETFUL: {{ .Values.used.breakFretful | quote }}
  DREAMER_STYLE: {{ .Values.used.dreamerStyle | quote }}
  MADLY_STAIRCASE: {{ .Values.used.madlyStaircase | quote }}
  PROGRAMMING: {{ .Values.used.programming | quote }}
  REBEL_CASKET_BATTALION: {{ .Values.used.rebelCasketBattalion | quote }}
  STUPID_SURVIVAL: {{ .Values.used.stupidSurvival | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "used.fullname" . }}-used
  labels:
  {{- include "used.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: used
spec:
  replicas: {{ .Values.used.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: used
      app.kubernetes.io/name: institution
    {{- include "used.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: used
        app.kubernetes.io/name: institution
      {{- include "used.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5765f1605c323cf71964b6d09b3ea0c16c5601738b0f9e14c573490ae2bc36ad
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "used.fullname" . }}-used
        image: {{ .Values.used.used.image.repository }}:{{ .Values.used.used.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.used.used.imagePullPolicy }}
        name: used
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.used.used.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.used.used.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "used.fullname" . }}-used
  labels:
  {{- include "used.labels" . | nindent 4 }}
spec:
  type: {{ .Values.used.type }}
  selector:
    app.kubernetes.io/instance: used
    app.kubernetes.io/name: institution
  {{- include "used.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.used.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
used:
  breakFretful: architect
  dreamerStyle: moldy
  madlyStaircase: sincere
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  programming: nonconformist
  rebelCasketBattalion: ink
  replicas: 1
  stupidSurvival: volatile
  type: ClusterIP
  used:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
