# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "trailpatrol.fullname" . }}-trailpatrol
  labels:
  {{- include "trailpatrol.labels" . | nindent 4 }}
data:
  ATELIER_IDEA: {{ .Values.trailpatrol.atelierIdea | quote }}
  BEHALF: {{ .Values.trailpatrol.behalf | quote }}
  CHANCE_TESTIMONIAL_INDEPENDENT: {{ .Values.trailpatrol.chanceTestimonialIndependent
    | quote }}
  FOREST: {{ .Values.trailpatrol.forest | quote }}
  HOUSEHOLD_BUILD: {{ .Values.trailpatrol.householdBuild | quote }}
  ID_CUSTODY_COLLECTION: {{ .Values.trailpatrol.idCustodyCollection | quote }}
  JACKAL_SPEAKING_LAB: {{ .Values.trailpatrol.jackalSpeakingLab | quote }}
  MANDOLIN_JUGGLE_NECKTIE: {{ .Values.trailpatrol.mandolinJuggleNecktie | quote }}
  PORTER_COTTAGE: {{ .Values.trailpatrol.porterCottage | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "trailpatrol.fullname" . }}-trailpatrol
  labels:
  {{- include "trailpatrol.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: trailpatrol
spec:
  replicas: {{ .Values.trailpatrol.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: trailpatrol
      app.kubernetes.io/name: speech
    {{- include "trailpatrol.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: trailpatrol
        app.kubernetes.io/name: speech
      {{- include "trailpatrol.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 78e245e58aa89bf9925112233049386e6c9503ee2f0a8fdeefead862c61d0763
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "trailpatrol.fullname" . }}-trailpatrol
        image: {{ .Values.trailpatrol.trailpatrol.image.repository }}:{{ .Values.trailpatrol.trailpatrol.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.trailpatrol.trailpatrol.imagePullPolicy }}
        name: trailpatrol
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.trailpatrol.trailpatrol.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.trailpatrol.trailpatrol.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "trailpatrol.fullname" . }}-trailpatrol
  labels:
  {{- include "trailpatrol.labels" . | nindent 4 }}
spec:
  type: {{ .Values.trailpatrol.type }}
  selector:
    app.kubernetes.io/instance: trailpatrol
    app.kubernetes.io/name: speech
  {{- include "trailpatrol.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.trailpatrol.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
trailpatrol:
  atelierIdea: fetch
  behalf: decade
  chanceTestimonialIndependent: congress
  forest: database
  householdBuild: multiply
  idCustodyCollection: julienne
  jackalSpeakingLab: critique
  mandolinJuggleNecktie: popsicle
  porterCottage: earnings
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  trailpatrol:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
