# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "servitude.fullname" . }}-servitude
  labels:
  {{- include "servitude.labels" . | nindent 4 }}
data:
  ANNOYED_SNOWBOARDING_SHEARLING: {{ .Values.servitude.annoyedSnowboardingShearling
    | quote }}
  ARROW_MULTIPLY_SPARKLE: {{ .Values.servitude.arrowMultiplySparkle | quote }}
  DIDACTIC_HURDLE_ENIGMA: {{ .Values.servitude.didacticHurdleEnigma | quote }}
  DRUDGERY: {{ .Values.servitude.drudgery | quote }}
  FLUME_TROLLEY: {{ .Values.servitude.flumeTrolley | quote }}
  HOMOSEXUALITY_DEMOCRAT_MANSERVANT: {{ .Values.servitude.homosexualityDemocratManservant
    | quote }}
  MILE_NOTHING_MANTEL: {{ .Values.servitude.mileNothingMantel | quote }}
  PORT: {{ .Values.servitude.port | quote }}
  REPRODUCE_GULLIBLE_RAIL: {{ .Values.servitude.reproduceGullibleRail | quote }}
  SEGMENT_ESPADRILLE: {{ .Values.servitude.segmentEspadrille | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "servitude.fullname" . }}-servitude
  labels:
  {{- include "servitude.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: servitude
spec:
  replicas: {{ .Values.servitude.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: servitude
      app.kubernetes.io/name: exuberant
    {{- include "servitude.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: servitude
        app.kubernetes.io/name: exuberant
      {{- include "servitude.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f833c92e3bb590dfe720d8c085246b74f916ae6e0d44f6e48f3da622ecffb53e
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "servitude.fullname" . }}-servitude
        image: {{ .Values.servitude.servitude.image.repository }}:{{ .Values.servitude.servitude.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.servitude.servitude.imagePullPolicy }}
        name: servitude
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.servitude.servitude.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.servitude.servitude.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "servitude.fullname" . }}-servitude
  labels:
  {{- include "servitude.labels" . | nindent 4 }}
spec:
  type: {{ .Values.servitude.type }}
  selector:
    app.kubernetes.io/instance: servitude
    app.kubernetes.io/name: exuberant
  {{- include "servitude.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.servitude.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
servitude:
  annoyedSnowboardingShearling: rhetorical
  arrowMultiplySparkle: invoice
  didacticHurdleEnigma: dwelling
  drudgery: precede
  flumeTrolley: restroom
  homosexualityDemocratManservant: learning
  mileNothingMantel: lipoprotein
  port: wad
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  reproduceGullibleRail: overwrought
  segmentEspadrille: cape
  servitude:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
