# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "embassy.fullname" . }}-embassy
  labels:
  {{- include "embassy.labels" . | nindent 4 }}
data:
  ARROW_BONFIRE_BAGGAGE: {{ .Values.embassy.arrowBonfireBaggage | quote }}
  BOUNDLESS_SPORT: {{ .Values.embassy.boundlessSport | quote }}
  BROCOLLI_MARATHON_LATHE: {{ .Values.embassy.brocolliMarathonLathe | quote }}
  CAPER: {{ .Values.embassy.caper | quote }}
  CLUSTER_SOAK: {{ .Values.embassy.clusterSoak | quote }}
  DIALECT_OPPOSITION_CONSUMER: {{ .Values.embassy.dialectOppositionConsumer | quote
    }}
  EMBARRASS_PURRING: {{ .Values.embassy.embarrassPurring | quote }}
  MARBLE_PINE_DEDUCTION: {{ .Values.embassy.marblePineDeduction | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "embassy.fullname" . }}-embassy
  labels:
  {{- include "embassy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: embassy
spec:
  replicas: {{ .Values.embassy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: embassy
      app.kubernetes.io/name: essence
    {{- include "embassy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: embassy
        app.kubernetes.io/name: essence
      {{- include "embassy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ba1618845596de51de3d04abd0ba7cc708aab858c6efd75471065e0a234c9073
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "embassy.fullname" . }}-embassy
        image: {{ .Values.embassy.embassy.image.repository }}:{{ .Values.embassy.embassy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.embassy.embassy.imagePullPolicy }}
        name: embassy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.embassy.embassy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.embassy.embassy.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "embassy.fullname" . }}-embassy
  labels:
  {{- include "embassy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.embassy.type }}
  selector:
    app.kubernetes.io/instance: embassy
    app.kubernetes.io/name: essence
  {{- include "embassy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.embassy.ports | toYaml | nindent 2 -}}
embassy:
  arrowBonfireBaggage: mama
  boundlessSport: visual
  brocolliMarathonLathe: lumberman
  caper: loyalty
  clusterSoak: employ
  dialectOppositionConsumer: absent
  embarrassPurring: eleventh
  embassy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  marblePineDeduction: heartache
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
