# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "immigration.fullname" . }}-immigration
  labels:
  {{- include "immigration.labels" . | nindent 4 }}
data:
  CLASSIFICATION_BRACE: {{ .Values.immigration.classificationBrace | quote }}
  COUNSELING_TOREADOR: {{ .Values.immigration.counselingToreador | quote }}
  ENSURE_CROSS: {{ .Values.immigration.ensureCross | quote }}
  TRILLION_SUBCONSCIOUS_BUILD: {{ .Values.immigration.trillionSubconsciousBuild |
    quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "immigration.fullname" . }}-immigration
  labels:
  {{- include "immigration.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: immigration
spec:
  replicas: {{ .Values.immigration.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: immigration
      app.kubernetes.io/name: troop
    {{- include "immigration.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: immigration
        app.kubernetes.io/name: troop
      {{- include "immigration.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4c02f774dad6ae5f5761b47ea8f198433c5f3ec2d3186581a1a086e69bc7f30b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "immigration.fullname" . }}-immigration
        image: {{ .Values.immigration.immigration.image.repository }}:{{ .Values.immigration.immigration.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.immigration.immigration.imagePullPolicy }}
        name: immigration
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.immigration.immigration.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.immigration.immigration.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "immigration.fullname" . }}-immigration
  labels:
  {{- include "immigration.labels" . | nindent 4 }}
spec:
  type: {{ .Values.immigration.type }}
  selector:
    app.kubernetes.io/instance: immigration
    app.kubernetes.io/name: troop
  {{- include "immigration.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.immigration.ports | toYaml | nindent 2 -}}
immigration:
  classificationBrace: waistband
  counselingToreador: prepare
  ensureCross: palm
  immigration:
    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
  replicas: 1
  trillionSubconsciousBuild: pompom
  type: ClusterIP
kubernetesClusterDomain: cluster.local
