# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "internet.fullname" . }}-internet
  labels:
  {{- include "internet.labels" . | nindent 4 }}
data:
  ANARCHY_TOWEL_KIDNEY: {{ .Values.internet.anarchyTowelKidney | quote }}
  BECK_NECTAR: {{ .Values.internet.beckNectar | quote }}
  CAROTENE_ACCORD_LITERATE: {{ .Values.internet.caroteneAccordLiterate | quote }}
  CASHEW: {{ .Values.internet.cashew | quote }}
  CHIVE_CELSIUS: {{ .Values.internet.chiveCelsius | quote }}
  CONGA_MATURE: {{ .Values.internet.congaMature | quote }}
  EXTINCTION_CREPE_LIBIDO: {{ .Values.internet.extinctionCrepeLibido | quote }}
  SPECIFY: {{ .Values.internet.specify | quote }}
  TERRAPIN_ACCIDENTAL: {{ .Values.internet.terrapinAccidental | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "internet.fullname" . }}-internet
  labels:
  {{- include "internet.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: internet
spec:
  replicas: {{ .Values.internet.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: internet
      app.kubernetes.io/name: phrasing
    {{- include "internet.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: internet
        app.kubernetes.io/name: phrasing
      {{- include "internet.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 295fe4ebf751b2ffa2919a79948977592fbda670ae8367d9c712e78d582aa3e9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "internet.fullname" . }}-internet
        image: {{ .Values.internet.internet.image.repository }}:{{ .Values.internet.internet.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.internet.internet.imagePullPolicy }}
        name: internet
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.internet.internet.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.internet.internet.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "internet.fullname" . }}-internet
  labels:
  {{- include "internet.labels" . | nindent 4 }}
spec:
  type: {{ .Values.internet.type }}
  selector:
    app.kubernetes.io/instance: internet
    app.kubernetes.io/name: phrasing
  {{- include "internet.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.internet.ports | toYaml | nindent 2 -}}
internet:
  anarchyTowelKidney: frighten
  beckNectar: gander
  caroteneAccordLiterate: civilization
  cashew: withhold
  chiveCelsius: arrogant
  congaMature: legitimacy
  extinctionCrepeLibido: caboose
  internet:
    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
  specify: gentleman
  terrapinAccidental: urn
  type: ClusterIP
kubernetesClusterDomain: cluster.local
