# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "upset.fullname" . }}-upset
  labels:
  {{- include "upset.labels" . | nindent 4 }}
data:
  BRIEFING: {{ .Values.upset.briefing | quote }}
  DEFORMATION_MANGO: {{ .Values.upset.deformationMango | quote }}
  GEOLOGY: {{ .Values.upset.geology | quote }}
  SUPREME_TONALITY_EXHIBITION: {{ .Values.upset.supremeTonalityExhibition | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "upset.fullname" . }}-upset
  labels:
  {{- include "upset.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: upset
spec:
  replicas: {{ .Values.upset.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: upset
      app.kubernetes.io/name: schnitzel
    {{- include "upset.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: upset
        app.kubernetes.io/name: schnitzel
      {{- include "upset.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d1ec51c242f8fe22f69e3adf5f39a98363f685e675f0a38e4abb5053ad2db7a9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "upset.fullname" . }}-upset
        image: {{ .Values.upset.upset.image.repository }}:{{ .Values.upset.upset.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.upset.upset.imagePullPolicy }}
        name: upset
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.upset.upset.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.upset.upset.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "upset.fullname" . }}-upset
  labels:
  {{- include "upset.labels" . | nindent 4 }}
spec:
  type: {{ .Values.upset.type }}
  selector:
    app.kubernetes.io/instance: upset
    app.kubernetes.io/name: schnitzel
  {{- include "upset.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.upset.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
upset:
  briefing: reach
  deformationMango: overtake
  geology: magnet
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  supremeTonalityExhibition: scarce
  type: ClusterIP
  upset:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
