web-app

by Unique AI

Helm chartv5.1.0Verified publisher

The 'web-app' chart is a "convenience" chart from Unique AG that can generically be used to deploy web-content serving workloads to Kubernetes. Note that this chart assumes that you have a valid contract with Unique AG and thus access to the required Docker images.

About this chart

web-app

The 'web-app' chart is a "convenience" chart from Unique AG that can generically be used to deploy web-content serving workloads to Kubernetes.

Note that this chart assumes that you have a valid contract with Unique AG and thus access to the required Docker images.

Implementation Details

OCI availibility

This chart is available both as Helm Repository as well as OCI artefact.

helm repo add unique https://unique-ag.github.io/helm-charts/
helm install my-web-app unique/web-app --version 5.1.0

# or
helm install my-web-app oci://ghcr.io/unique-ag/helm-charts/web-app --version 5.1.0

Docker Images

The chart itself uses ghcr.io/unique-ag/chart-testing-service as its base image. This is due to automation aspects and because there is no specific appVersion or service delivered with it. Using chart-testing-service Unique can improve the charts quality without dealing with the complexity of private registries during testing. Naturally, when deploying the Unique product, the image will be replaced with the actual Unique image(s). You can inspect the image here and it is served from ghcr.io/unique-ag/chart-testing-service.

Networking

The chart supports the Gateway API and its resources. This is the recommended way to go forward. The Gateway API is a Kubernetes-native way to manage your networking resources and is part of the Gateway API project.

The Gateway API is enabled by default, you need to selectively enable different routes or use extraRoutes to configure them. See Routes for more information.

Routes

With 2.0.0 the chart supports routes (namely all routes from gateway.networking.k8s.io). While routes, not yet enabled by default, abstract certain complexity away from the chart consumer, extraRoutes can be used by power-users to configure each route exactly to their needs.

To use Routes per se you need two things:

HTTPS Redirects

Routes do not redirect to HTTPS by default. This redirect must be handled in the upstream services or extended via extraAnnotations. This is not due to a lack of security but the fact that the chart is agnostic to the upstream service and its configuration so enforcing a redirect can lead to unexpected behavior and indefinite redirects. Also, most modern browsers prefix all requests with https as a secure practice.

Root Route

The Root Route is a convenience Ingress/Gateway that routes all traffic from the root of the domain to the applied service. This functionality works different depending on the Ingress/Gateway Class used. In order to keep the chart agnostic to the Ingress Class, the chart uses the .Capabilities.APIVersions built-in object.

Only one root route per cluster (technically per hostname) should be deployed to avoid conflicts or race conditions respectively.

Network Policies

The chart supports Kubernetes Network Policies to control traffic flow to and from pods. Network Policies are a Kubernetes-native way to implement network segmentation and can help improve security by restricting network communication.

Network Policy Flavors

The chart supports two network policy flavors:

  • kubernetes (default): Standard Kubernetes NetworkPolicy resources
  • cilium: Cilium's CiliumNetworkPolicy resources with enhanced features
networkPolicy:
  enabled: true
  flavor: kubernetes  # or "cilium"
  policyTypes:
    - Ingress
    - Egress
  ingress:
    # Allow ingress from monitoring namespace
    - from:
        - namespaceSelector:
            matchLabels:
              name: monitoring
      ports:
        - protocol: TCP
          port: 3000
  egress:
    # Allow egress to backend namespace
    - to:
        - namespaceSelector:
            matchLabels:
              name: backend
      ports:
        - protocol: TCP
          port: 8080
    # Allow external HTTPS/HTTP access
    - to: []
      ports:
        - protocol: TCP
          port: 443
        - protocol: TCP
          port: 80

Kubernetes vs Cilium Differences

When using flavor: cilium, the chart will:

  • Use apiVersion: cilium.io/v2 and kind: CiliumNetworkPolicy
  • Use endpointSelector instead of podSelector in the spec
  • Support advanced Cilium-specific features in your rules

When using flavor: kubernetes (default), the chart will:

  • Use apiVersion: networking.k8s.io/v1 and kind: NetworkPolicy
  • Use standard podSelector in the spec
  • Maintain compatibility with any Kubernetes CNI that supports NetworkPolicy

Important Notes:

  • Network Policies require a CNI (Container Network Interface) that supports them, such as Calico, Cilium, or Weave Net
  • For Cilium flavor, you must have Cilium CNI installed with CiliumNetworkPolicy CRDs
  • Once a Network Policy is applied to a pod, it becomes "isolated" and only allowed traffic will be permitted
  • Always include DNS resolution (port 53/UDP) in your egress rules if pods need to resolve hostnames
  • Test your network policies thoroughly to avoid inadvertently blocking required traffic

You can find Network Policy examples in the ci/networkpolicy-values.yaml (Kubernetes) and ci/networkpolicy-cilium-values.yaml (Cilium) files.

Values

KeyTypeDefaultDescription
affinityobject{}
autoscaling.enabledboolfalse
autoscaling.maxReplicasint100
autoscaling.minReplicasint1
autoscaling.targetCPUUtilizationPercentageint80
autoscaling.targetMemoryUtilizationPercentageint80
envobject{}
envSecretsobject{}
extraEnvCMlist[]
extraEnvSecretslist[]
extraObjectslist[]extraObjects allows you to add additional Kubernetes objects to the manifest. It is the responsibility of the user to ensure that the objects are valid, that they do not conflict with the existing objects and that they are not containing any sensitive information
extraRoutesobject{"extra-route-1":{"additionalRules":[],"annotations":{},"apiVersion":"gateway.networking.k8s.io/v1","enabled":false,"filters":[],"hostnames":[],"kind":"HTTPRoute","labels":{},"matches":[{"path":{"type":"PathPrefix","value":"/"}}],"parentRefs":[{"group":"gateway.networking.k8s.io","kind":"Gateway","name":"kong","namespace":"kong-system"}]}}BETA: Configure additional gateway routes for the chart here. More routes can be added by adding a dictionary key like the 'extra-route-1' route. In order for this to install, the Gateway API CRDs must be installed in the cluster.
extraRoutes.extra-route-1.annotationsobject{}Set the route annotations
extraRoutes.extra-route-1.apiVersionstring"gateway.networking.k8s.io/v1"Set the route apiVersion, e.g. gateway.networking.k8s.io/v1 or gateway.networking.k8s.io/v1alpha2
extraRoutes.extra-route-1.enabledboolfalseEnables or disables the route
extraRoutes.extra-route-1.hostnameslist[]Add hostnames to the route, will be matched against the host header of the request
extraRoutes.extra-route-1.kindstring"HTTPRoute"Set the route kind Valid options are GRPCRoute, HTTPRoute, TCPRoute, TLSRoute, UDPRoute
extraRoutes.extra-route-1.labelsobject{}Set the route labels
extraRoutes.extra-route-1.matcheslist[{"path":{"type":"PathPrefix","value":"/"}}]which match conditions should be applied to the route
extraRoutes.extra-route-1.parentRefslist[{"group":"gateway.networking.k8s.io","kind":"Gateway","name":"kong","namespace":"kong-system"}]parentRefs define the parent gateway(s) that the route will be associated with
fullnameOverridestring""
imageobject{"pullPolicy":"IfNotPresent","repository":"ghcr.io/unique-ag/chart-testing-service","tag":"1.1.0"}The image to use for this specific deployment and its cron jobs
image.pullPolicystring"IfNotPresent"pullPolicy, Unique recommends to never use 'Always'
image.repositorystring"ghcr.io/unique-ag/chart-testing-service"Repository, where the Unique service image is pulled from - for Unique internal deployments, these is the internal release repository - for client deployments, this will refer to the client's repository where the images have been mirrored too Note that it is bad practice and not advised to directly pull from Uniques release repository Read in the readme on why the helm chart comes bundled with the unique-ag/chart-testing-service image
image.tagstring"1.1.0"tag, most often will refer one of the latest release of the Unique service Read in the readme on why the helm chart comes bundled with the unique-ag/chart-testing-service image
imagePullSecretslist[]
nameOverridestring""
networkPolicyobject{"annotations":{},"egress":[{"to":[{"podSelector":{}}]},{"ports":[{"port":53,"protocol":"UDP"}],"to":[]}],"enabled":false,"flavor":"kubernetes","ingress":[{"from":[{"podSelector":{}}]}],"labels":{}}networkPolicy allows you to define network policies for the deployed pods Network policies are used to control traffic flow to and from pods
networkPolicy.annotationsobject{}Additional annotations to add to the network policy
networkPolicy.egresslist[{"to":[{"podSelector":{}}]},{"ports":[{"port":53,"protocol":"UDP"}],"to":[]}]Egress rules configuration
networkPolicy.egress[0]object{"to":[{"podSelector":{}}]}Default egress rules applied to all pods Allow egress to pods in the same namespace
networkPolicy.enabledboolfalseEnable or disable network policy creation
networkPolicy.flavorstring"kubernetes"Network policy flavor - "kubernetes" for standard NetworkPolicy or "cilium" for CiliumNetworkPolicy
networkPolicy.ingresslist[{"from":[{"podSelector":{}}]}]Ingress rules configuration
networkPolicy.ingress[0]object{"from":[{"podSelector":{}}]}Default ingress rules applied to all pods Allow ingress from pods in the same namespace
networkPolicy.labelsobject{}Additional labels to add to the network policy
nodeSelectorobject{}
pdbobject{"minAvailable":1}Define the pod disruption budget for this deployment Is templated as YAML so all kuberentes native types are supported
pdb.minAvailableint1This setting matches the charts default replica count, make sure to adapt your PDB if you chose a different sizing of your deployment
podAnnotationsobject{}Define additional pod annotations for all the pods
podLabelsobject{}Define additional pod labels for all the pods
podSecurityContextobject{"seccompProfile":{"type":"RuntimeDefault"}}PodSecurityContext for the pod(s)
podSecurityContext.seccompProfileobject{"type":"RuntimeDefault"}seccompProfile, controls the seccomp profile for the container, defaults to 'RuntimeDefault'
probes.enabledbooltrue
probes.liveness.httpGet.pathstring"/api/health"
probes.liveness.httpGet.portstring"http"
probes.liveness.initialDelaySecondsint5
probes.readiness.httpGet.pathstring"/api/health"
probes.readiness.httpGet.portstring"http"
probes.readiness.initialDelaySecondsint5
replicaCountint2Basic replica count of the deployment make sure to adapt all sizing related values if you change this (e.g. the Pod Disruption Budget pdb)
resourcesobject{}
rollingUpdate.maxSurgeint1
rollingUpdate.maxUnavailableint0
routesobject{"gateway":{"name":"kong","namespace":"system"},"hostname":"chart-testing-web-app.example.com","pathPrefix":"","paths":{"default":{"blockList":["/metrics"],"enabled":true,"extraAnnotations":{}},"root":{"enabled":false,"redirectPath":"/chart-testing"}}}routes is a special object designed for Unique web-apps. It abstracts a lot of complexity and allows for a simple configuration of routes. ⚠️ Unique defaults to Kong as its API Gateway (the middlewares especially), and the routes object is designed to work with Kong. If you are using a different API Gateway, you will need to use extraRoutes.
routes.gatewayobject{"name":"kong","namespace":"system"}gateway to use
routes.gateway.namestringkongname of the gateway
routes.gateway.namespacestringsystemnamespace of the gateway
routes.pathPrefixstringdefaults to the /fullname of the servicepathPrefix allows setting the default prefix (fullname) for all paths
routes.paths.default.blockListlist["/metrics"]explicitly list paths to block
routes.paths.rootobject`{"enabled":false,"redi

Deploy web-app with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has web-app on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartweb-app is pinned at v5.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply