sops-operator

by craftypath

Helm chartv0.8.0App v0.8.0Verified publisher

A Helm chart for SOPS Operator

About this chart

SOPS Operator

This chart creates a SOPS Operator deployment on a Kubernetes cluster using the Helm package manager.

Configuration

The following table lists the configurable parameters of the SOPS Operator chart and their default values.

ParameterDescriptionDefault
image.repositoryDocker image repositorycraftypath/sops-operator
image.tagOverrides the image tag whose default is the chart versionThe chart's version
image.pullPolicyDocker image pull policyIfNotPresent
replicasThe number of replicas to run1
imagePullSecretsImage pull secrets[]
nameOverrideOverrides the app name``
fullnameOverrideOverrides the full name for generating resources names``
rbac.createSpecifies whether RBAC resources should be createdfalse
rbac.clusterScopedCustom RBAC rules for the master pod. If not specified, the cluster-admin ClusterRole is usedtrue
serviceAccount.createSpecifies whether a service account should be createdtrue
serviceAccount.nameIf not set and serviceAcount.create is true, a name is generated using the fullname template""
deployment.labelsAdditional labels for the deployment{}
deployment.annotationsAnnotations for the deployment{}
pod.labelsAdditional labels for the pod{}
pod.annotationsAnnotations for the pod{}
podSecurityContextThe security context for the container{fsGroup: 1000, runAsNonRoot: true, runAsUser: 1000, runAsGroup: 1000}
containerSecurityContextThe security context for the pod{readOnlyRootFilesystem: true, privileged: false, allowPrivilegeEscalation: false}
resourcesPod resource requests and limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsNode taints to tolerate[]
affinityPod affinity{}
watchNamespaceA comma-separated list of namespaces to watch. Leave empty to watch all namespaces. Ignored if rbac.clusterScoped is set to false``
secret.existingSecretThe name of an existing secret to use``
secret.labelsAdditional labels for the secret``
secret.annotationsAnnotations for the secret``
secret.stringDataIf set, a secret is created that configures access to the cloud provider's KMS{}
secret.mountPathIf set, the secret is mounted at this path. If left empty, environment variables are created from the secret""
envA list of additional environment variables[]

Configuring Cloud Provider Credentials

The SOPS Operator Helm chart allows for fairly flexible credentials configuration.

The following examples show how SOPS Operator can be configured for AWS, Azure, and GCP using credentials configured via secret. It should also be possible to use managed identities, but this has not been tested yet. Whatever SOPS supports should be possible. Please refer to the SOPS documentation to find out what is required for your cloud provider.

AWS

Using Environment Variables

If secret.mountPath is not set, environment variables are created from the secret.

secret:
  stringData:
    AWS_SECRET_ACCESS_KEY=AKIA0123456789ABCDEF
    AWS_SECRET_ACCESS_KEY=random+access+key+0123456789abcdef+12345

Using a Credentials File

If secret.mountPath is set, the secret is mounted to the specified path. If necessary, environment variables, such as AWS_DEFAULT_REGION or AWS_SHARED_CREDENTIALS_FILE, can be configured.

secret:
  mountPath: /home/sops-operator/.aws
  stringData:
    credentials: |
      [default]
      aws_access_key_id = AKIA0123456789ABCDEF
      aws_secret_access_key = random+access+key+0123456789abcdef+12345

env:
  - name: AWS_DEFAULT_REGION
    value: eu-central-1

Azure

secret:
  stringData:
    AZURE_TENANT_ID: 12345678-1234-5678-1234-12345678
    AZURE_CLIENT_ID: 12345678-1234-5678-1234-1234567890ab
    AZURE_CLIENT_SECRET: 12345678-1234-5678-1234-1234567890ab

GCP

secret:
  mountPath: /home/sops-operator/.google/credentials.json
  stringData: |
    {
      "type": "service_account",
      "project_id": "myproject",
      "private_key_id": "1234567890123456789012345678901234567890",
      "private_key": "-----BEGIN PRIVATE KEY....==\n-----END PRIVATE KEY-----\n",
      "client_email": "[email protected]",
      "client_id": "123456789012345678901",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/[email protected]"
    }

env:
  - name: GOOGLE_APPLICATION_CREDENTIALS
    value: /home/sops-operator/.google/credentials.json

Deploy sops-operator with OpenTenant

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