# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "traveler.fullname" . }}-traveler
  labels:
  {{- include "traveler.labels" . | nindent 4 }}
data:
  DEER: {{ .Values.traveler.deer | quote }}
  DENSITY_CONTRIBUTOR: {{ .Values.traveler.densityContributor | quote }}
  PARTICIPATE_INTERPRETATION: {{ .Values.traveler.participateInterpretation | quote
    }}
  PASTORALIST_DEED_METRONOME: {{ .Values.traveler.pastoralistDeedMetronome | quote
    }}
  PATE_BIKE: {{ .Values.traveler.pateBike | quote }}
  PLATTER_TOASTER: {{ .Values.traveler.platterToaster | quote }}
  RIOT_SUPER: {{ .Values.traveler.riotSuper | quote }}
  THRONE: {{ .Values.traveler.throne | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "traveler.fullname" . }}-traveler
  labels:
  {{- include "traveler.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: traveler
spec:
  replicas: {{ .Values.traveler.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: traveler
      app.kubernetes.io/name: logo
    {{- include "traveler.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: traveler
        app.kubernetes.io/name: logo
      {{- include "traveler.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 55f99a9636c5a6f7276daa8b33cfeb538fc106ba66a062bf4eb8cc527435f17d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "traveler.fullname" . }}-traveler
        image: {{ .Values.traveler.traveler.image.repository }}:{{ .Values.traveler.traveler.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.traveler.traveler.imagePullPolicy }}
        name: traveler
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.traveler.traveler.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.traveler.traveler.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "traveler.fullname" . }}-traveler
  labels:
  {{- include "traveler.labels" . | nindent 4 }}
spec:
  type: {{ .Values.traveler.type }}
  selector:
    app.kubernetes.io/instance: traveler
    app.kubernetes.io/name: logo
  {{- include "traveler.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.traveler.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
traveler:
  deer: silky
  densityContributor: netbook
  participateInterpretation: liability
  pastoralistDeedMetronome: pressurisation
  pateBike: lye
  platterToaster: penicillin
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  riotSuper: pita
  throne: vaulting
  traveler:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
