Application example

Deploy Python to Kubernetes

Run a small Python API on the universal chart; add an Nginx sidecar when you need a separate Service target port.

Chart fidelity

Examples below match Universal Helm Chart application 0.4.3 keys from values.yaml and docs/configuration.md. Replace ghcr.io/example-org/* images and hostnames with your own.

Chart 0.4.3 — args / multi-port / service.enabled

From application 0.4.3: main container args (default []); Deployment revisionHistoryLimit (default 10); multi-port via containerPorts and service.ports; optional chart-managed Service via service.enabled (default true). When service.ports is set, Ingress / simple HTTPRoute / NOTES use the first entry (templates/_helpers.tpl application.servicePort). Legacy single-port service.name / service.port / service.protocol / service.appProtocol remain supported. Set service.enabled: false when the workload does not need a chart-managed Service. Do not invent other port keys.

Install the chart once

helm repo add universal https://chaser100.github.io/u-helm-chart
helm repo update
helm search repo universal/application --versions

Package: Artifact Hub · universal-helm-chart/application.

values.yaml

Copy from the reference example, then replace the image registry and hostname. Keys below are valid chart values (see linked example page for the full file).

replicaCount: 2
image: ghcr.io/example-org/python-api
imageTag: "1.0.0"
imagePullPolicy: IfNotPresent
service:
  port: 8080
  # Service targetPort may reference a named container port (see templates/7_service.yaml)
  targetPort: nginx
securityContext:
  runAsNonRoot: true
  runAsUser: 10001
  runAsGroup: 10001
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: ["ALL"]
podSecurityContext:
  seccompProfile:
    type: RuntimeDefault
env:
  - name: APP_ENV
    value: production
envFrom:
  - configMapRef:
      name: python-config
configMaps:
  - name: python-config
    data:
      LOG_LEVEL: info
      WORKERS: "2"
extraContainers:
  enabled: true
  containers:
    - name: nginx
      image: nginxinc/nginx-unprivileged
      imageTag: "1.27-alpine"
      imagePullPolicy: IfNotPresent
      command: ["nginx", "-g", "daemon off;"]
      ports:
        - name: nginx
          containerPort: 8081
          protocol: TCP
readinessProbe:
  httpGet: {path: /health, port: http}
livenessProbe:
  httpGet: {path: /health, port: http}
route:
  enabled: true
  gateway: external
  gatewayNamespace: gateway-system
  sectionName: https
  hostname: python.example.com

Sidecars use extraContainers.enabled + containers[]. Full Nginx ConfigMap + volumeMounts live on the Python example page.

Deploy

helm upgrade --install python universal/application --version 0.4.3 \
  --namespace apps --create-namespace \
  --values values.yaml

Verify

helm status python -n apps
kubectl get pods,svc,httproute -n apps -l app.kubernetes.io/instance=python
kubectl get httproute -n apps
# After DNS/Gateway attachment:
# curl -fsS https://YOUR_HOSTNAME/health

GitOps: point an Argo CD Application at chart repo https://chaser100.github.io/u-helm-chart, chart application, and this values file.

Open the full reference example → · Gateway API guide → · Getting started →