# Exercise 1: Turn manifests into a Helm chart (medium)
#
# Setup: helm create petpal-api   (then replace the generated templates with yours)
# This file contains the chart's values.yaml (top) and the templates you must write
# (as comments). Validate with:
#   helm lint ./petpal-api && helm template t ./petpal-api -f values-prod.yaml
#
# Write templates/deployment.yaml, service.yaml, ingress.yaml, hpa.yaml, configmap.yaml so that:
#   TODO 1: names use a fullname helper "<release>-<chart>" (truncated to 63 chars) and
#           standard labels app.kubernetes.io/{name,instance,version,managed-by}
#   TODO 2: replicas only rendered when autoscaling.enabled is false
#   TODO 3: image tag defaults to .Chart.AppVersion when image.tag is empty
#   TODO 4: env vars rendered from the `env` map; the ConfigMap content changes trigger a
#           rollout (checksum/config annotation)
#   TODO 5: ingress.yaml and hpa.yaml rendered only when enabled
#   TODO 6: values.schema.json requiring image.repository and resources.requests
#   TODO 7: a values-prod.yaml with 3 replicas → autoscaling 3–15 at 60% CPU, ingress
#           host api.petpal.io with TLS, LOG_LEVEL=warn
#
# CHECKLIST:
# [ ] helm lint passes; helm template with default values renders no Ingress/HPA.
# [ ] With values-prod.yaml: Ingress + HPA rendered, Deployment has no replicas field.
# [ ] Changing env.LOG_LEVEL changes the checksum annotation.
# [ ] helm install on kind works; helm upgrade with a new tag creates revision 2;
#     helm rollback restores revision 1.
replicaCount: 2

image:
  repository: ghcr.io/petpal/api
  tag: ""
  pullPolicy: IfNotPresent

service:
  port: 80
  targetPort: 8080

resources:
  requests:
    cpu: 250m
    memory: 256Mi
  limits:
    memory: 512Mi

env:
  LOG_LEVEL: info
  FEATURE_FLAGS: ""

autoscaling:
  enabled: false
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 65

ingress:
  enabled: false
  className: nginx
  host: ""
  tls: false
# TODO 1-7: templates and values-prod.yaml (separate files in the chart)
