capsule

by Project Capsule

Helm chartv0.15.2App 0.15.2Apache-2.0Verified publisher

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 webhooks have moved to webhooks.hooks.
  • mutatingWebhooksTimeoutSeconds has moved to webhooks.mutatingWebhooksTimeoutSeconds
  • validatingWebhooksTimeoutSeconds has moved to webhooks.validatingWebhooksTimeoutSeconds

Values

For resource policies, CEL apply conditions, and compatibility guidance, see the managed-resource reference and replication documentation.

CustomResourceDefinition Lifecycle

KeyTypeDefaultDescription
crds.annnotationsobject{}Extra Annotations for CRDs
crds.createConfigboolfalseCreate additionally CapsuleConfiguration even if CRDs are exclusive
crds.createDiagnosticsboolfalseCreate Diagnostic Dashboards even if CRDs are exclusive
crds.createRBACboolfalseCreate RBAC and Serviceaccount even if CRDs are exclusive
crds.exclusiveboolfalseOnly install the CRDs, no other primitives
crds.inlineboolfalse
crds.installbooltrueInstall the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations)
crds.labelsobject{}Extra Labels for CRDs

Global Parameters

KeyTypeDefaultDescription
global.jobs.kubectl.affinityobject{}Set affinity rules
global.jobs.kubectl.annotationsobject{}Annotations to add to the job.
global.jobs.kubectl.backoffLimitint4Backofflimit for jobs
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.imagePullSecretslist[]ImagePullSecrets
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":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.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":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.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.jobs.postDelete.enabledbooltrueEnable Post Delete Job to remove Capsule's mutating and validating webhook configurations
global.jobs.postInstall.enabledbooltrueEnable Post Install Job
global.jobs.preDelete.enabledbooltrueEnable Pre Delete Job
global.openshift.enabledboolfalseRun 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.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 pod
certManager.additionalSANSlist[]Specify additional SANS to add to the certificate
certManager.generateCertificatesbooltrueSpecifies whether capsule webhooks certificates should be generated using cert-manager
conversions.service.caBundlestring""CABundle for the webhook service
conversions.service.namestring""Custom service name for the webhook service
conversions.service.namespacestring""Custom service namespace for the webhook service
conversions.service.portinteger, nullnilCustom service port for the webhook service
conversions.service.urlstring""The URL where the capsule webhook services are running (Overwrites cluster scoped service definition)
customAnnotationsobject{}Additional annotations which will be added to all resources created by Capsule helm chart
customLabelsobject{}Additional labels which will be added to all resources created by Capsule helm chart
extraManifestslist[]Array of additional resources to be created alongside Capsule helm chart
imagePullSecretslist[]Configuration for imagePullSecrets so that you can use a private images registry.
jobsobject{}Deprecated, use .global.jobs.kubectl instead
nodeSelectorobject{}Set the node selector for the Capsule pod
openshift.etcdEncryption.enabledboolfalseExclude the kube-storage-version-migrator from the replications webhook (required when etcd encryption is enabled on OpenShift)
podAnnotationsobject{}Annotations to add to the capsule pod.
podLabelsobject{}Labels to add to the capsule pod.
podSecurityContextobject{"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.
portslist[]Set additional ports for the deployment
priorityClassNamestring""Set the priority class name of the Capsule pod
proxy.enabledboolfalseEnable Installation of Capsule Proxy
rbac.customquotasobject{"create":false,"labels":{}}Allow the creation of CustomQuotas
rbac.resourcepoolclaimsobject{"create":false,"labels":{}}Allow the creation of ResourcePoolClaims
rbac.resourcesobject{"create":false,"labels":{}}Allow the creation of TenantResources
replicaCountint1Set the replica count for capsule pod
securityContextobject{"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.annotationsobject{}Annotations to add to the service account.
serviceAccount.createbooltrueSpecifies whether a service account should be created.
serviceAccount.imagePullSecretslist[]
serviceAccount.namestring""The name of the service account to use. If not set and serviceAccount.create=true, a name is generated using the fullname template
tls.createboolfalseWhen cert-manager is disabled, Capsule will generate the TLS certificate for webhook and CRDs conversion.
tls.enableControllerboolfalseStart the Capsule controller that injects the CA into mutating and validating webhooks, and CRD as well.
tls.namestring""Override name of the Capsule TLS Secret name when externally managed.
tolerationslist[]Set list of tolerations for the Capsule pod
topologySpreadConstraintslist[]Set topology spread constraints for the Capsule pod

Manager Parameters

KeyTypeDefaultDescription
manager.apiPriorityAndFairness.enabledboolfalseChange 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.flowApiVersionstring"flowcontrol.apiserver.k8s.io/v1"Declare ApiVersion used for Flow
manager.apiPriorityAndFairness.matchingPrecedenceint900Only 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.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
manager.daemonsetStrategyobject{"type":"RollingUpdate"}Daemonset Strategy
manager.deploymentStrategyobject{"type":"RollingUpdate"}Deployment Strategy
manager.envlist[]Additional Environment Variables
manager.extraArgslist[]A list of extra arguments for the capsule controller
manager.hostNetworkboolfalseSpecifies 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.hostPIDboolfalseSpecifies if the container should be started in hostPID mode.
manager.hostUsersbooltrueDon't use Host Users (User Namespaces)
manager.image.pullPolicystring"IfNotPresent"Set the image pull policy.
manager.image.registrystring"ghcr.io"Set the image registry of capsule.
manager.image.repositorystring"projectcapsule/capsule"Set the image repository of capsule.
manager.image.tagstring""Overrides the image tag whose default is the chart appVersion.
manager.kindstring"Deployment"Set the controller deployment mode as Deployment or DaemonSet.
manager.livenessProbeobject{"httpGet":{"path":"/healthz","port":10080}}Configure the liveness probe using Deployment probe spec
manager.options.administratorslist[]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.allowServiceAccountPromotionboolfalseServiceAccounts 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.annotationsobject{}Additional annotations to add to the CapsuleConfiguration resource
manager.options.cacheInvalidationstring"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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcapsule is pinned at v0.15.2 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