pulsar-resources-operator

by StreamNative

Helm chartv0.22.0App v0.22.0

Pulsar Resources Operator Helm chart for Pulsar Resources Management on Kubernetes

About this chart

pulsar-resources-operator

Pulsar Resources Operator Helm chart for Pulsar Resources Management on Kubernetes

Installing the Chart

To install the chart with the release name my-release:

$ helm repo add streamnative https://charts.streamnative.io
$ helm -n <namespace> install my-release streamnative/pulsar-resources-operator --create-namespace

Requirements

Kubernetes: >= 1.18.0-0

Pulsar: >= 2.9.0.x

CRD Upgrade

Helm installs files from crds/ during helm install, but does not update them during helm upgrade. Pull the target chart and apply its CRDs explicitly:

$ helm pull streamnative/pulsar-resources-operator --version <chart-version> --untar
$ kubectl apply -f pulsar-resources-operator/crds
$ helm -n <namespace> upgrade my-release streamnative/pulsar-resources-operator --version <chart-version>

Uninstalling the release does not remove CRDs or existing custom resources.

Hardened Configuration

The chart leaves ServiceAccount token automount and security contexts unchanged by default. Set serviceAccount.automountServiceAccountToken to true or false to configure the chart-created ServiceAccount explicitly; omit it or use null to leave the field unset. When serviceAccount.create=false, configure automount on the externally managed ServiceAccount instead. Changing only the ServiceAccount setting does not trigger a Deployment rollout; recreate the operator Pods for the change to take effect.

The operator needs Kubernetes API credentials for watches, status updates, and leader election. Setting automount to false without supplying credentials breaks the standard in-cluster configuration. To disable automatic mounting while retaining API access, save the following as values-hardened.yaml. It explicitly projects a short-lived ServiceAccount token at client-go's default path and provides writable temporary storage while keeping the container root filesystem read-only:

serviceAccount:
  automountServiceAccountToken: false

securityContext:
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  runAsNonRoot: true
  capabilities:
    drop:
      - ALL

extraVolumes:
  - name: kube-api-access
    projected:
      sources:
        - serviceAccountToken:
            path: token
            expirationSeconds: 3600
        - configMap:
            name: kube-root-ca.crt
            items:
              - key: ca.crt
                path: ca.crt
        - downwardAPI:
            items:
              - path: namespace
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
  - name: tmp
    emptyDir: {}

extraVolumeMounts:
  - name: kube-api-access
    mountPath: /var/run/secrets/kubernetes.io/serviceaccount
    readOnly: true
  - name: tmp
    mountPath: /tmp

Apply the override alongside your existing release values:

$ helm -n <namespace> upgrade --install my-release streamnative/pulsar-resources-operator -f values.yaml -f values-hardened.yaml
  • Merge any existing extraVolumes and extraVolumeMounts into the override before applying it: Helm replaces lists rather than appending to them. Preserve existing authentication and cloud storage mounts.
  • The cluster must support ServiceAccount token projection and provide the kube-root-ca.crt ConfigMap in the release namespace. With no explicit audience, the token uses the API server's default audience. The kubelet rotates the token, and client-go refreshes credentials from the mounted file. Do not use a subPath mount for the token because it would prevent projected updates from reaching the container.
  • Keep /tmp writable by the container's runtime UID: inline OAuth2 credentials and PulsarPackage downloads create temporary files there. Verify these operations, not just operator startup, when enabling a read-only root filesystem. Size temporary storage according to package sizes and concurrency.
  • This example does not pin a UID or GID, so the image or cluster can supply the appropriate non-root identity. Validate the actual image and any additional security requirements in your environment.
  • Explicit token projection does not remove API credentials or reduce the ServiceAccount's RBAC permissions. Check the rendered ServiceAccount and Deployment, the admitted Pod, and your policy reports. A policy forbidding all API tokens still requires an approved exception or another authentication method.
  • Before rollout, verify leader election, resource reconciliation, token rotation, and the OAuth2 and package operations you use in a test environment. Rendering this example is not a runtime or policy check.

Values

KeyTypeDefaultDescription
affinityobject{}Add affinity for pod
annotationsobject{}Add annotations for the deployment
cloudStorageobject{"azure":{"accountName":"","credentials":{"accountKey":"","create":false,"sasToken":"","secretName":"azure-credentials","useAccountKey":true},"enabled":false},"gcs":{"enabled":false,"serviceAccount":{"key":{"create":false,"json":"","mountPath":"/var/secrets/google","secretName":"gcs-credentials"},"name":"","useWorkloadIdentity":false}},"s3":{"credentials":{"accessKeyId":"","create":false,"secretAccessKey":"","secretName":"aws-credentials"},"enabled":false,"region":""}}Cloud storage configuration used when downloading files for PulsarPackage resources.
cloudStorage.azureobject{"accountName":"","credentials":{"accountKey":"","create":false,"sasToken":"","secretName":"azure-credentials","useAccountKey":true},"enabled":false}Azure Blob Storage configuration
cloudStorage.azure.accountNamestring""Azure storage account name
cloudStorage.azure.credentialsobject{"accountKey":"","create":false,"sasToken":"","secretName":"azure-credentials","useAccountKey":true}Azure credentials configuration
cloudStorage.azure.credentials.accountKeystring""Storage account key (only used if create is true)
cloudStorage.azure.credentials.createboolfalseCreate a new secret for Azure credentials
cloudStorage.azure.credentials.sasTokenstring""SAS token (only used if create is true)
cloudStorage.azure.credentials.secretNamestring"azure-credentials"Existing secret name
cloudStorage.azure.credentials.useAccountKeybooltrueUse account key for authentication (if false, will use SAS token)
cloudStorage.azure.enabledboolfalseEnable Azure Blob Storage support
cloudStorage.gcsobject{"enabled":false,"serviceAccount":{"key":{"create":false,"json":"","mountPath":"/var/secrets/google","secretName":"gcs-credentials"},"name":"","useWorkloadIdentity":false}}Google Cloud Storage configuration
cloudStorage.gcs.enabledboolfalseEnable Google Cloud Storage support
cloudStorage.gcs.serviceAccountobject{"key":{"create":false,"json":"","mountPath":"/var/secrets/google","secretName":"gcs-credentials"},"name":"","useWorkloadIdentity":false}Service account configuration
cloudStorage.gcs.serviceAccount.keyobject{"create":false,"json":"","mountPath":"/var/secrets/google","secretName":"gcs-credentials"}Service account key configuration (only used if useWorkloadIdentity is false)
cloudStorage.gcs.serviceAccount.key.createboolfalseCreate a new secret for service account key
cloudStorage.gcs.serviceAccount.key.jsonstring""Service account key JSON content (only used if create is true)
cloudStorage.gcs.serviceAccount.key.mountPathstring"/var/secrets/google"Mount path of the service account key file
cloudStorage.gcs.serviceAccount.key.secretNamestring"gcs-credentials"Existing secret name containing the service account key
cloudStorage.gcs.serviceAccount.namestring""GCP service account email for Workload Identity Format: GSA_NAME@PROJECT_ID.iam.gserviceaccount.com
cloudStorage.gcs.serviceAccount.useWorkloadIdentityboolfalseUse GCP Workload Identity (recommended for GKE)
cloudStorage.s3object{"credentials":{"accessKeyId":"","create":false,"secretAccessKey":"","secretName":"aws-credentials"},"enabled":false,"region":""}AWS S3 configuration
cloudStorage.s3.credentialsobject{"accessKeyId":"","create":false,"secretAccessKey":"","secretName":"aws-credentials"}AWS credentials secret configuration
cloudStorage.s3.credentials.accessKeyIdstring""AWS access key ID (only used if create is true)
cloudStorage.s3.credentials.createboolfalseCreate a new secret for AWS credentials
cloudStorage.s3.credentials.secretAccessKeystring""AWS secret access key (only used if create is true)
cloudStorage.s3.credentials.secretNamestring"aws-credentials"Existing secret name
cloudStorage.s3.enabledboolfalseEnable AWS S3 support
cloudStorage.s3.regionstring""AWS region
containerNamestring"manager"Name of the operator container
extraVolumeMountslist[]Additional volume mounts for the operator container. Paths are available to file-based PulsarConnection authentication.
extraVolumeslist[]Additional pod volumes for the operator deployment.
features.alwaysUpdatePulsarResourceboolfalseRe-apply observed managed Pulsar resources even when their Kubernetes resources are already Ready. Prefer temporary use for upgrade remediation because it increases Pulsar admin API load on reconciliations and resyncs.
features.maxConcurrentReconcilesint1Maximum concurrent reconciles for the PulsarConnection and RoleBinding controllers. Values of 0 or 1 leave the flags unset and use the binary default.
features.resyncPeriodint10Base informer resync period in hours.
features.retryCountint5Number of retries used by the PulsarConnection-managed resource reconciler.
fullnameOverridestring""It will override the name of deployment
image.manager.registrystring"docker.io"Container image registry.
image.manager.repositorystring"streamnative/pulsar-resources-operator"Container image repository.
image.manager.tagstring""Container image tag. Defaults to chart appVersion when empty.
image.pullPolicystring"IfNotPresent"Image pull policy for the container.
imagePullSecretslist[]Image pull secrets for private registries, for example - name: gcr.
labelsobject{}Add labels for the deployment
nameOverridestring""It will override the value of label app.kubernetes.io/name on pod
namespacestring""Namespace for chart resources. When empty, use Helm release namespace.
nodeSelectorobject{}Add NodeSelector for pod schedule
podAnnotationsobject{}Add annotations for the deployment pod
podLabelsobject{}Add labels for the deployment pod
podSecurityContextobject{}Add security context for pod
replicaCountint1Number of operator replicas.
resourcesobject{}Add resource limits and requests
securityContextobject{}Add security context for container
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.automountServiceAccountTokenbool/nullnilOptional token automount setting for the chart-created ServiceAccount. Null preserves Kubernetes' default behavior. When false, explicitly mount Kubernetes API credentials; see the hardened configuration example in the README.
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""Name of the service account to use. When empty and create=true, the chart generates a name.
terminationGracePeriodSecondsint10Graceful termination period in seconds.
tolerationslist[]Add tolerations

Deploy pulsar-resources-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pulsar-resources-operator 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 chartpulsar-resources-operator is pinned at v0.22.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