Make headless service names configurable via environment variables across all Kubernetes manifests.
- Verify current appsettings.json has ServiceName configuration
- Update appsettings.json to support env var fallback pattern
- Verify PodCoordinator.cs properly reads from IConfiguration
- Add SERVICE_NAME env var to all app deployments
- Ensure consistency with headless service names
- Review which manifests need headless services
- Add headless services where missing
- Ensure naming consistency
- k8s/hpa/step-01-base-workload.yaml - Added SERVICE_NAME env var
- k8s/vpa/step-01-base-workload.yaml - Added SERVICE_NAME env var
- k8s/qos/step-01-guaranteed-qos.yaml - Added SERVICE_NAME and POD_NAMESPACE env vars
- k8s/combined/step-01-hpa-with-guaranteed-qos.yaml - Added SERVICE_NAME and POD_NAMESPACE env vars
- k8s/deployment.yaml - Added SERVICE_NAME env var
- k8s/combined/step-02-vpa-with-burstable-qos.yaml - Added backend-burstable-headless
- k8s/combined/step-03-complete-demo.yaml - Added 3 headless services
- k8s/qos/step-02-burstable-qos.yaml - Added burstable-qos-headless
- k8s/qos/step-03-besteffort-qos.yaml - Added besteffort-qos-headless
- k8s/qos/step-04-mixed-qos-eviction-demo.yaml - Added 3 headless services
- k8s/qos/step-05-priority-classes.yaml - Added 2 headless services
- Reference step-01-base-workload.yaml via VPA resources
env:
- name: SERVICE_NAME
value: "k8s-demo-app-headless"apiVersion: v1
kind: Service
metadata:
name: k8s-demo-app-headless
namespace: [appropriate-namespace]
spec:
clusterIP: None
selector:
app: k8s-demo-app
ports:
- port: 80
targetPort: 8080{
"ServiceName": "k8s-demo-app-headless"
}- All deployments with app containers have SERVICE_NAME env var
- All namespaces with deployments have corresponding headless services
- Service names match between env vars and service definitions
- PodCoordinator can discover pods via configurable service name