# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "turtle.fullname" . }}-turtle
  labels:
  {{- include "turtle.labels" . | nindent 4 }}
data:
  BIG_BAY_ITEM: {{ .Values.turtle.bigBayItem | quote }}
  GREASY_LIMIT_STATUESQUE: {{ .Values.turtle.greasyLimitStatuesque | quote }}
  INVENTION: {{ .Values.turtle.invention | quote }}
  MAGNET: {{ .Values.turtle.magnet | quote }}
  NICETY_TELEVISION_WORRY: {{ .Values.turtle.nicetyTelevisionWorry | quote }}
  PRICING_REVITALIZATION_NAMING: {{ .Values.turtle.pricingRevitalizationNaming |
    quote }}
  SUNFLOWER_UNIFORMITY_LOUD: {{ .Values.turtle.sunflowerUniformityLoud | quote }}
  TIRE_PARADISE_FRIENDSHIP: {{ .Values.turtle.tireParadiseFriendship | quote }}
  UPTIGHT_SOCKS: {{ .Values.turtle.uptightSocks | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "turtle.fullname" . }}-turtle
  labels:
  {{- include "turtle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: turtle
spec:
  replicas: {{ .Values.turtle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: turtle
      app.kubernetes.io/name: waterfront
    {{- include "turtle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: turtle
        app.kubernetes.io/name: waterfront
      {{- include "turtle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 93c313daf6884ee9a8481d918676987c4715bb2fd72e3ccf201317fe65dce82a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "turtle.fullname" . }}-turtle
        image: {{ .Values.turtle.turtle.image.repository }}:{{ .Values.turtle.turtle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.turtle.turtle.imagePullPolicy }}
        name: turtle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.turtle.turtle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.turtle.turtle.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "turtle.fullname" . }}-turtle
  labels:
  {{- include "turtle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.turtle.type }}
  selector:
    app.kubernetes.io/instance: turtle
    app.kubernetes.io/name: waterfront
  {{- include "turtle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.turtle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
turtle:
  bigBayItem: restructure
  greasyLimitStatuesque: pumped
  invention: larva
  magnet: eaves
  nicetyTelevisionWorry: manufacturing
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pricingRevitalizationNaming: derivative
  replicas: 1
  sunflowerUniformityLoud: stacking
  tireParadiseFriendship: accuracy
  turtle:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  uptightSocks: ecosystem
