capsule-proxy
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
kubeconfigfile 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.
-
Add this repository:
$ helm repo add projectcapsule https://projectcapsule.github.io/charts -
Install the Chart:
$ helm install capsule-proxy projectcapsule/capsule-proxy -n capsule-system -
Show the status:
$ helm status capsule-proxy -n capsule-system -
Upgrade the Chart
$ helm upgrade capsule-proxy projectcapsule/capsule-proxy -n capsule-system -
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
| Key | Type | Default | Description |
|---|---|---|---|
| crds.annnotations | object | {} | Extra Annotations for CRDs |
| crds.install | bool | true | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) |
| crds.keep | bool | true | Keep the CustomResourceDefinitions (when the chart is deleted) |
| crds.labels | object | {} | Extra Labels for CRDs |
Global Parameters
| Key | Type | Default | Description |
|---|---|---|---|
| global.jobs.certs.affinity | object | {} | Set affinity rules |
| global.jobs.certs.annotations | object | {} | Annotations to add to the certgen job. |
| global.jobs.certs.hostUsers | bool | true | Don't use Host Users (User Namespaces) for the job pods. Always disabled when global.openshift.requiredScc is restricted-v3. |
| global.jobs.certs.image.pullPolicy | string | "IfNotPresent" | Set the image pull policy of the post install certgen job |
| global.jobs.certs.image.registry | string | "registry.k8s.io" | Set the image repository of the post install certgen job |
| global.jobs.certs.image.repository | string | "ingress-nginx/kube-webhook-certgen" | Set the image repository of the post install certgen job |
| global.jobs.certs.image.tag | string | "v1.6.9" | Set the image tag of the post install certgen job |
| global.jobs.certs.nodeSelector | object | {} | Set the node selector |
| global.jobs.certs.podSecurityContext | object | {"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}} | Security context for the job pods. enabled: null means enabled, unless global.openshift.enabled is set. |
| global.jobs.certs.priorityClassName | string | "" | Set a pod priorityClassName |
| global.jobs.certs.resources | object | {} | Job resources |
| global.jobs.certs.restartPolicy | string | "Never" | Set the restartPolicy |
| global.jobs.certs.securityContext | object | {"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.tolerations | list | [] | Set list of tolerations |
| global.jobs.certs.topologySpreadConstraints | list | [] | Set Topology Spread Constraints |
| global.jobs.certs.ttlSecondsAfterFinished | int | 60 | Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete. |
| global.jobs.kubectl.affinity | object | {} | Set affinity rules |
| global.jobs.kubectl.annotations | object | {} | Annotations to add to the job. |
| global.jobs.kubectl.hostUsers | bool | true | Don't use Host Users (User Namespaces) for the job pods. Always disabled when global.openshift.requiredScc is restricted-v3. |
| global.jobs.kubectl.image.pullPolicy | string | "IfNotPresent" | Set the image pull policy of the helm chart job |
| global.jobs.kubectl.image.registry | string | "docker.io" | Set the image repository of the helm chart job |
| global.jobs.kubectl.image.repository | string | "clastix/kubectl" | Set the image repository of the helm chart job |
| global.jobs.kubectl.image.tag | string | "" | Set the image tag of the helm chart job |
| global.jobs.kubectl.labels | object | {} | Labels to add to the job. |
| global.jobs.kubectl.nodeSelector | object | {} | Set the node selector |
| global.jobs.kubectl.podAnnotations | object | {} | Annotations to add to the job pod |
| global.jobs.kubectl.podLabels | object | {} | Labels to add to the job pod |
| global.jobs.kubectl.podSecurityContext | object | {"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}} | Security context for the job pods. enabled: null means enabled, unless global.openshift.enabled is set. |
| global.jobs.kubectl.priorityClassName | string | "" | Set a pod priorityClassName |
| global.jobs.kubectl.resources | object | {} | Job resources |
| global.jobs.kubectl.restartPolicy | string | "Never" | Set the restartPolicy |
| global.jobs.kubectl.securityContext | object | {"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.tolerations | list | [] | Set list of tolerations |
| global.jobs.kubectl.topologySpreadConstraints | list | [] | Set Topology Spread Constraints |
| global.jobs.kubectl.ttlSecondsAfterFinished | int | 60 | Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete. |
| global.openshift.enabled | bool | false | Run 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.requiredScc | string | "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
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Set affinity rules for the capsule-proxy pod. |
| annotations | object | {} | Annotations to add to the capsule-proxy deployment. |
| apiPriorityAndFairness.enabled | bool | false | Create a FlowSchema for capsule-proxy requests. |
| apiPriorityAndFairness.flowApiVersion | string | "flowcontrol.apiserver.k8s.io/v1" | Declare ApiVersion used for Flow |
| apiPriorityAndFairness.matchingPrecedence | int | 900 | FlowSchema matching precedence. Lower values have higher priority. |
| apiPriorityAndFairness.priorityLevelConfigurationSpec | object | See values.yaml | Priority 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.annnotations | object | {} | Extra Annotations for CRDs |
| crds.install | bool | true | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) |
| crds.keep | bool | true | Keep the CustomResourceDefinitions (when the chart is deleted) |
| crds.labels | object | {} | Extra Labels for CRDs |
| daemonset.hostNetwork | bool | false | Use the host network namespace for capsule-proxy pod. |
| daemonset.hostPort | bool | false | Binding the capsule-proxy listening port to the host port. |
| env | list | [] | Additional environment variables |
| extraManifests | list | [] | Array of additional resources to be created alongside Capsule-Proxy helm chart |
| hostNetwork | bool | false | When deployed as DaemonSet use |
| hostUsers | bool | true | Don't use Host Users (User Namespaces) |
| httproute.annotations | object | {} | Annotations to add to the httproute. |
| httproute.enabled | bool | false | Specifies whether an httproute should be created. |
| httproute.hostnames | list | [] | List of hostnames for HTTPRoute |
| httproute.labels | object | {} | Labels to add to the httproute. |
| httproute.parentRefs | list | [] | Gateway API parentRefs (list of Gateway references) Must reference an existing Gateway resource |
| httproute.rules | list | [{"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}] | Rules Configuration Allows advanced routing with matches and filters |
| image.pullPolicy | string | "IfNotPresent" | Set the image pull policy. |
| image.registry | string | "ghcr.io" | Set the image registry for capsule-proxy |
| image.repository | string | "projectcapsule/capsule-proxy" | Set the image repository for capsule-proxy. |
| image.tag | string | "" | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | [] | Configuration for imagePullSecrets so that you can use a private images registry. |
| jobs | object | {"certs":{}} | Deprecated: Use global.jobs.certs instead |
| kind | string | "Deployment" | Set the deployment mode of the capsule-proxy as Deployment or DaemonSet. |
| livenessProbe | object | {"enabled":true,"httpGet":{"path":"/healthz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":20} | Proxy Liveness-Probe |
| nodeSelector | object | {} | Set the node selector for the capsule-proxy pod. |
| podAnnotations | object | {} | Annotations to add to the capsule-proxy pod. |
| podLabels | object | {} | Labels to add to the capsule-proxy pod. |
| podSecurityContext | object | {"enabled":null,"seccompProfile":{"type":"RuntimeDefault"}} | Security context for the capsule-proxy pod. enabled: null means enabled, unless global.openshift.enabled is set. |
| priorityClassName | string | "" | Specifies PriorityClass of the capsule-proxy pod. |
| rbac.clusterRole | string | "" | Controller ClusterRole |
| rbac.enabled | bool | true | Enable Creation of ClusterRoles |
| readinessProbe | object | {"enabled":true,"httpGet":{"path":"/readyz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":5} | Proxy Readyness-Probe |
| replicaCount | int | 1 | Set the replica count for capsule-proxy pod. |
| resources.limits.cpu | string | "200m" | Set the CPU requests assigned to the controller. |
| resources.limits.memory | string | "128Mi" | Set the memory requests assigned to the controller. |
| resources.requests.cpu | string | "200m" | Set the CPU limits assigned to the controller. |
| resources.requests.memory | string | "128Mi" | Set the memory limits assigned to the controller. |
| restartPolicy | string | "Always" | Set the restartPolicy for the capsule-proxy pod. |
| securityContext | object | `{"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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcapsule-proxy is pinned at v0.15.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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