capsule
A Helm chart to deploy the Capsule Operator for easily implementing, managing, and maintaining multitenancy and access control in Kubernetes.
About this chart
Deploying the Capsule Operator
Use the Capsule Operator for easily implementing, managing, and maintaining multitenancy and access control in Kubernetes. Please read our installation guide:
Major Changes
In the following sections you see actions which are required when you are upgrading to a specific version.
Upgrading to 0.7.x
Introduces a new methode to manage all capsule 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. This behavior is the new default.
Changed Values
The following Values have changed key or Value:
- All values from previous releases under
webhookshave moved towebhooks.hooks. mutatingWebhooksTimeoutSecondshas moved towebhooks.mutatingWebhooksTimeoutSecondsvalidatingWebhooksTimeoutSecondshas moved towebhooks.validatingWebhooksTimeoutSeconds
Values
For resource policies, CEL apply conditions, and compatibility guidance, see the managed-resource reference and replication documentation.
CustomResourceDefinition Lifecycle
| Key | Type | Default | Description |
|---|---|---|---|
| crds.annnotations | object | {} | Extra Annotations for CRDs |
| crds.createConfig | bool | false | Create additionally CapsuleConfiguration even if CRDs are exclusive |
| crds.createDiagnostics | bool | false | Create Diagnostic Dashboards even if CRDs are exclusive |
| crds.createRBAC | bool | false | Create RBAC and Serviceaccount even if CRDs are exclusive |
| crds.exclusive | bool | false | Only install the CRDs, no other primitives |
| crds.inline | bool | false | |
| crds.install | bool | true | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) |
| crds.labels | object | {} | Extra Labels for CRDs |
Global Parameters
| Key | Type | Default | Description |
|---|---|---|---|
| global.jobs.kubectl.affinity | object | {} | Set affinity rules |
| global.jobs.kubectl.annotations | object | {} | Annotations to add to the job. |
| global.jobs.kubectl.backoffLimit | int | 4 | Backofflimit for jobs |
| 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.imagePullSecrets | list | [] | ImagePullSecrets |
| 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":true,"seccompProfile":{"type":"RuntimeDefault"}} | Security context for the job pods. Ignored when global.openshift.enabled is set, unless jobs.podSecurityContext.enabled is set explicitly. |
| 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":true,"readOnlyRootFilesystem":true,"runAsGroup":1002,"runAsNonRoot":true,"runAsUser":1002} | Security context for the job containers. Ignored when global.openshift.enabled is set, unless jobs.securityContext.enabled is set explicitly. |
| 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.jobs.postDelete.enabled | bool | true | Enable Post Delete Job to remove Capsule's mutating and validating webhook configurations |
| global.jobs.postInstall.enabled | bool | true | Enable Post Install Job |
| global.jobs.preDelete.enabled | bool | true | Enable Pre Delete Job |
| global.openshift.enabled | bool | false | Run on OpenShift. Unless set explicitly, the pod/container securityContexts of the controller and jobs 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 pod |
| certManager.additionalSANS | list | [] | Specify additional SANS to add to the certificate |
| certManager.generateCertificates | bool | true | Specifies whether capsule webhooks certificates should be generated using cert-manager |
| conversions.service.caBundle | string | "" | CABundle for the webhook service |
| conversions.service.name | string | "" | Custom service name for the webhook service |
| conversions.service.namespace | string | "" | Custom service namespace for the webhook service |
| conversions.service.port | integer, null | nil | Custom service port for the webhook service |
| conversions.service.url | string | "" | The URL where the capsule webhook services are running (Overwrites cluster scoped service definition) |
| customAnnotations | object | {} | Additional annotations which will be added to all resources created by Capsule helm chart |
| customLabels | object | {} | Additional labels which will be added to all resources created by Capsule helm chart |
| extraManifests | list | [] | Array of additional resources to be created alongside Capsule helm chart |
| imagePullSecrets | list | [] | Configuration for imagePullSecrets so that you can use a private images registry. |
| jobs | object | {} | Deprecated, use .global.jobs.kubectl instead |
| nodeSelector | object | {} | Set the node selector for the Capsule pod |
| openshift.etcdEncryption.enabled | bool | false | Exclude the kube-storage-version-migrator from the replications webhook (required when etcd encryption is enabled on OpenShift) |
| podAnnotations | object | {} | Annotations to add to the capsule pod. |
| podLabels | object | {} | Labels to add to the capsule pod. |
| podSecurityContext | object | {"enabled":null,"runAsGroup":1002,"runAsNonRoot":true,"runAsUser":1002,"seccompProfile":{"type":"RuntimeDefault"}} | Set the securityContext for the Capsule pod. enabled: null means enabled, unless global.openshift.enabled is set. |
| ports | list | [] | Set additional ports for the deployment |
| priorityClassName | string | "" | Set the priority class name of the Capsule pod |
| proxy.enabled | bool | false | Enable Installation of Capsule Proxy |
| rbac.customquotas | object | {"create":false,"labels":{}} | Allow the creation of CustomQuotas |
| rbac.resourcepoolclaims | object | {"create":false,"labels":{}} | Allow the creation of ResourcePoolClaims |
| rbac.resources | object | {"create":false,"labels":{}} | Allow the creation of TenantResources |
| replicaCount | int | 1 | Set the replica count for capsule pod |
| securityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"enabled":null,"readOnlyRootFilesystem":true} | Set the securityContext for the Capsule container. enabled: null means enabled, unless global.openshift.enabled is set. |
| serviceAccount.annotations | object | {} | Annotations to add to the service account. |
| serviceAccount.create | bool | true | Specifies whether a service account should be created. |
| serviceAccount.imagePullSecrets | list | [] | |
| serviceAccount.name | string | "" | The name of the service account to use. If not set and serviceAccount.create=true, a name is generated using the fullname template |
| tls.create | bool | false | When cert-manager is disabled, Capsule will generate the TLS certificate for webhook and CRDs conversion. |
| tls.enableController | bool | false | Start the Capsule controller that injects the CA into mutating and validating webhooks, and CRD as well. |
| tls.name | string | "" | Override name of the Capsule TLS Secret name when externally managed. |
| tolerations | list | [] | Set list of tolerations for the Capsule pod |
| topologySpreadConstraints | list | [] | Set topology spread constraints for the Capsule pod |
Manager Parameters
| Key | Type | Default | Description |
|---|---|---|---|
| manager.apiPriorityAndFairness.enabled | bool | false | Change to true if you want to insulate the API calls made by Capsule admission controller activities. This will help ensure Capsule stability in busy clusters. Ref: https://kubernetes.io/docs/concepts/cluster-administration/flow-control/ |
| manager.apiPriorityAndFairness.flowApiVersion | string | "flowcontrol.apiserver.k8s.io/v1" | Declare ApiVersion used for Flow |
| manager.apiPriorityAndFairness.matchingPrecedence | int | 900 | Only the first matching FlowSchema for a given request matters. If multiple FlowSchemas match a single inbound request, it will be assigned based on the one with the highest matchingPrecedence. Ref: https://kubernetes.io/docs/concepts/cluster-administration/flow-control/#flowschema |
| manager.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 |
| manager.daemonsetStrategy | object | {"type":"RollingUpdate"} | Daemonset Strategy |
| manager.deploymentStrategy | object | {"type":"RollingUpdate"} | Deployment Strategy |
| manager.env | list | [] | Additional Environment Variables |
| manager.extraArgs | list | [] | A list of extra arguments for the capsule controller |
| manager.hostNetwork | bool | false | Specifies if the container should be started in hostNetwork mode. Required for use in some managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico), because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working |
| manager.hostPID | bool | false | Specifies if the container should be started in hostPID mode. |
| manager.hostUsers | bool | true | Don't use Host Users (User Namespaces) |
| manager.image.pullPolicy | string | "IfNotPresent" | Set the image pull policy. |
| manager.image.registry | string | "ghcr.io" | Set the image registry of capsule. |
| manager.image.repository | string | "projectcapsule/capsule" | Set the image repository of capsule. |
| manager.image.tag | string | "" | Overrides the image tag whose default is the chart appVersion. |
| manager.kind | string | "Deployment" | Set the controller deployment mode as Deployment or DaemonSet. |
| manager.livenessProbe | object | {"httpGet":{"path":"/healthz","port":10080}} | Configure the liveness probe using Deployment probe spec |
| manager.options.administrators | list | [] | Define entities which can act as Administrators in the capsule construct These entities are automatically owners for all existing tenants. Meaning they can add namespaces to any tenant. However they must be specific by using the capsule label for interacting with namespaces. Because if that label is not defined, it's assumed that namespace interaction was not targeted towards a tenant and will therefore be ignored by capsule. May also be handy in GitOps scenarios where certain service accounts need to be able to manage namespaces for all tenants. |
| manager.options.allowServiceAccountPromotion | bool | false | ServiceAccounts within tenant namespaces can be promoted to owners of the given tenant this can be achieved by labeling the serviceaccount and then they are considered owners. This can only be done by other owners of the tenant. However ServiceAccounts which have been promoted to owner can not promote further serviceAccounts. |
| manager.options.annotations | object | {} | Additional annotations to add to the CapsuleConfiguration resource |
| manager.options.cacheInvalidation | string | "0h30m0s" | Duration after which the in-memory cache is invalidated (based on usaage) and re-fetched from the API server |
| manag |
Deploy capsule with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has capsule 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 is pinned at v0.15.2 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