capsule-proxy

by Project Capsule

Helm chartv0.15.3App 0.15.3Apache-2.0Verified publisher

Helm Chart for Capsule Proxy, addon for Capsule, the multi-tenant Operator

About this chart

Deploying the Capsule-proxy

This project is an add-on for Capsule, the operator providing multi-tenancy in Kubernetes.

Requirements

  • Helm 3 is required when installing the Capsule-proxy chart. Follow Helm’s official steps for installing helm on your particular operating system.

  • A Kubernetes cluster 1.16+ with Capsule installed and following Admission Controllers enabled:

    • PodNodeSelector
    • LimitRanger
    • ResourceQuota
    • MutatingAdmissionWebhook
    • ValidatingAdmissionWebhook
  • A kubeconfig file accessing the Kubernetes cluster with cluster admin permissions.

Quick Start

The Capsule-proxy Chart can be used to instantly deploy the Capsule-proxy on your Kubernetes cluster.

  1. Add this repository:

     $ helm repo add projectcapsule https://projectcapsule.github.io/charts
    
  2. Install the Chart:

     $ helm install capsule-proxy projectcapsule/capsule-proxy -n capsule-system
    
  3. Show the status:

     $ helm status capsule-proxy -n capsule-system
    
  4. Upgrade the Chart

     $ helm upgrade capsule-proxy projectcapsule/capsule-proxy -n capsule-system
    
  5. Uninstall the Chart

     $ helm uninstall capsule-proxy -n capsule-system
    

Upgrading the Chart

Intsructions to upgrade the chart the versions, which may remove features or introduce breaking changes.

0.7.x

Introduces a new methode to manage all capsule-proxy CRDs and their lifecycle. We are no longer relying on the native CRD hook with the Helm Chart. The hook only allows to manage CRDs on install and uninstall but we can't deliver updates to the CRDs. When you newly install the chart we recommend to set crds.install to true. This will manage the CRDs with the Helm Chart.

If you are upgrading to this release, you can choose to set global.crds.install to true (by default false). However you need to add metadata to the existing CRDs so they can be correctly managed with the new flow. Run the following commands:

kubectl label crd proxysettings.capsule.clastix.io  app.kubernetes.io/managed-by=Helm
kubectl annotate crd proxysettings.capsule.clastix.io meta.helm.sh/release-namespace=capsule-system # might be different
kubectl annotate crd proxysettings.capsule.clastix.io meta.helm.sh/release-name=capsule-proxy # might be different

With the new CRD management we can release update CRDs bundled with the chart. The Chart can be uninstalled and the CRDs are still kept.

Customize the installation

When using OCI we recommend our dedicated OCI Repository for this chart

There are two methods for specifying overrides of values during chart installation: --values and --set.

The --values option is the preferred method because it allows you to keep your overrides in a YAML file, rather than specifying them all on the command line. Create a copy of the YAML file values.yaml and add your overrides to it.

Specify your overrides file when you install the chart:

    $ helm install capsule-proxy projectcapsule/capsule-proxy --values myvalues.yaml -n capsule-system

The values in your overrides file myvalues.yaml will override their counterparts in the chart’s values.yaml file. Any values in values.yaml that weren’t overridden will keep their defaults.

If you only need to make minor customizations, you can specify them on the command line by using the --set option. For example:

    $ helm install capsule-proxy projectcapsule/capsule-proxy --set "kind=DaemonSet" -n capsule-system

CustomResourceDefinition Lifecycle

KeyTypeDefaultDescription
crds.annnotationsobject{}Extra Annotations for CRDs
crds.installbooltrueInstall the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations)
crds.keepbooltrueKeep the CustomResourceDefinitions (when the chart is deleted)
crds.labelsobject{}Extra Labels for CRDs

Global Parameters

KeyTypeDefaultDescription
global.jobs.certs.affinityobject{}Set affinity rules
global.jobs.certs.annotationsobject{}Annotations to add to the certgen job.
global.jobs.certs.hostUsersbooltrueDon't use Host Users (User Namespaces) for the job pods. Always disabled when global.openshift.requiredScc is restricted-v3.
global.jobs.certs.image.pullPolicystring"IfNotPresent"Set the image pull policy of the post install certgen job
global.jobs.certs.image.registrystring"registry.k8s.io"Set the image repository of the post install certgen job
global.jobs.certs.image.repositorystring"ingress-nginx/kube-webhook-certgen"Set the image repository of the post install certgen job
global.jobs.certs.image.tagstring"v1.6.9"Set the image tag of the post install certgen job
global.jobs.certs.nodeSelectorobject{}Set the node selector
global.jobs.certs.podSecurityContextobject{"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}}Security context for the job pods. enabled: null means enabled, unless global.openshift.enabled is set.
global.jobs.certs.priorityClassNamestring""Set a pod priorityClassName
global.jobs.certs.resourcesobject{}Job resources
global.jobs.certs.restartPolicystring"Never"Set the restartPolicy
global.jobs.certs.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"enabled":null,"readOnlyRootFilesystem":true,"runAsGroup":1002,"runAsNonRoot":true,"runAsUser":1002}Security context for the job containers. enabled: null means enabled, unless global.openshift.enabled is set.
global.jobs.certs.tolerationslist[]Set list of tolerations
global.jobs.certs.topologySpreadConstraintslist[]Set Topology Spread Constraints
global.jobs.certs.ttlSecondsAfterFinishedint60Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete.
global.jobs.kubectl.affinityobject{}Set affinity rules
global.jobs.kubectl.annotationsobject{}Annotations to add to the job.
global.jobs.kubectl.hostUsersbooltrueDon't use Host Users (User Namespaces) for the job pods. Always disabled when global.openshift.requiredScc is restricted-v3.
global.jobs.kubectl.image.pullPolicystring"IfNotPresent"Set the image pull policy of the helm chart job
global.jobs.kubectl.image.registrystring"docker.io"Set the image repository of the helm chart job
global.jobs.kubectl.image.repositorystring"clastix/kubectl"Set the image repository of the helm chart job
global.jobs.kubectl.image.tagstring""Set the image tag of the helm chart job
global.jobs.kubectl.labelsobject{}Labels to add to the job.
global.jobs.kubectl.nodeSelectorobject{}Set the node selector
global.jobs.kubectl.podAnnotationsobject{}Annotations to add to the job pod
global.jobs.kubectl.podLabelsobject{}Labels to add to the job pod
global.jobs.kubectl.podSecurityContextobject{"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}}Security context for the job pods. enabled: null means enabled, unless global.openshift.enabled is set.
global.jobs.kubectl.priorityClassNamestring""Set a pod priorityClassName
global.jobs.kubectl.resourcesobject{}Job resources
global.jobs.kubectl.restartPolicystring"Never"Set the restartPolicy
global.jobs.kubectl.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"enabled":null,"readOnlyRootFilesystem":true,"runAsGroup":1002,"runAsNonRoot":true,"runAsUser":1002}Security context for the job containers. enabled: null means enabled, unless global.openshift.enabled is set.
global.jobs.kubectl.tolerationslist[]Set list of tolerations
global.jobs.kubectl.topologySpreadConstraintslist[]Set Topology Spread Constraints
global.jobs.kubectl.ttlSecondsAfterFinishedint60Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete.
global.openshift.enabledboolfalseRun on OpenShift. Unless set explicitly, the pod/container securityContexts are omitted (so the SCC assigns UID, fsGroup and SELinux level) and the openshift.io/required-scc annotation is added to all pods.
global.openshift.requiredSccstring"restricted-v2"SCC requested on all pods through the openshift.io/required-scc annotation. With restricted-v3, hostUsers is disabled on all pods.

General Parameters

KeyTypeDefaultDescription
affinityobject{}Set affinity rules for the capsule-proxy pod.
annotationsobject{}Annotations to add to the capsule-proxy deployment.
apiPriorityAndFairness.enabledboolfalseCreate a FlowSchema for capsule-proxy requests.
apiPriorityAndFairness.flowApiVersionstring"flowcontrol.apiserver.k8s.io/v1"Declare ApiVersion used for Flow
apiPriorityAndFairness.matchingPrecedenceint900FlowSchema matching precedence. Lower values have higher priority.
apiPriorityAndFairness.priorityLevelConfigurationSpecobjectSee values.yamlPriority level configuration. The block is directly forwarded into the priorityLevelConfiguration, so you can use whatever specification you want. ref: https://kubernetes.io/docs/concepts/cluster-administration/flow-control/#prioritylevelconfiguration
crds.annnotationsobject{}Extra Annotations for CRDs
crds.installbooltrueInstall the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations)
crds.keepbooltrueKeep the CustomResourceDefinitions (when the chart is deleted)
crds.labelsobject{}Extra Labels for CRDs
daemonset.hostNetworkboolfalseUse the host network namespace for capsule-proxy pod.
daemonset.hostPortboolfalseBinding the capsule-proxy listening port to the host port.
envlist[]Additional environment variables
extraManifestslist[]Array of additional resources to be created alongside Capsule-Proxy helm chart
hostNetworkboolfalseWhen deployed as DaemonSet use
hostUsersbooltrueDon't use Host Users (User Namespaces)
httproute.annotationsobject{}Annotations to add to the httproute.
httproute.enabledboolfalseSpecifies whether an httproute should be created.
httproute.hostnameslist[]List of hostnames for HTTPRoute
httproute.labelsobject{}Labels to add to the httproute.
httproute.parentRefslist[]Gateway API parentRefs (list of Gateway references) Must reference an existing Gateway resource
httproute.ruleslist[{"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]Rules Configuration Allows advanced routing with matches and filters
image.pullPolicystring"IfNotPresent"Set the image pull policy.
image.registrystring"ghcr.io"Set the image registry for capsule-proxy
image.repositorystring"projectcapsule/capsule-proxy"Set the image repository for capsule-proxy.
image.tagstring""Overrides the image tag whose default is the chart appVersion.
imagePullSecretslist[]Configuration for imagePullSecrets so that you can use a private images registry.
jobsobject{"certs":{}}Deprecated: Use global.jobs.certs instead
kindstring"Deployment"Set the deployment mode of the capsule-proxy as Deployment or DaemonSet.
livenessProbeobject{"enabled":true,"httpGet":{"path":"/healthz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":20}Proxy Liveness-Probe
nodeSelectorobject{}Set the node selector for the capsule-proxy pod.
podAnnotationsobject{}Annotations to add to the capsule-proxy pod.
podLabelsobject{}Labels to add to the capsule-proxy pod.
podSecurityContextobject{"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}}Security context for the capsule-proxy pod. enabled: null means enabled, unless global.openshift.enabled is set.
priorityClassNamestring""Specifies PriorityClass of the capsule-proxy pod.
rbac.clusterRolestring""Controller ClusterRole
rbac.enabledbooltrueEnable Creation of ClusterRoles
readinessProbeobject{"enabled":true,"httpGet":{"path":"/readyz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":5}Proxy Readyness-Probe
replicaCountint1Set the replica count for capsule-proxy pod.
resources.limits.cpustring"200m"Set the CPU requests assigned to the controller.
resources.limits.memorystring"128Mi"Set the memory requests assigned to the controller.
resources.requests.cpustring"200m"Set the CPU limits assigned to the controller.
resources.requests.memorystring"128Mi"Set the memory limits assigned to the controller.
restartPolicystring"Always"Set the restartPolicy for the capsule-proxy pod.
securityContextobject`{"allowPrivilegeEscalation":false,

Deploy capsule-proxy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has capsule-proxy 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 chartcapsule-proxy is pinned at v0.15.3 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