spire-nested

by SPIFFE

Helm chartv0.31.1App 1.16.0Apache-2.0Verified publisher

A Helm chart for deploying the complete Spire stack including: spire-server, spire-agent, spiffe-csi-driver, spiffe-oidc-discovery-provider and spire-controller-manager.

About this chart

spire

A Helm chart for deploying the complete Spire stack including: spire-server, spire-agent, spiffe-csi-driver, spiffe-oidc-discovery-provider and spire-controller-manager.

Homepage: https://github.com/spiffe/helm-charts-hardened/tree/main/charts/spire

Install Instructions

Non Production

To do a quick install suitable for testing in something like minikube:

helm upgrade --install -n spire-server spire-crds spire-crds --repo https://spiffe.github.io/helm-charts-hardened/ --create-namespace
helm upgrade --install -n spire-server spire spire-nested --repo https://spiffe.github.io/helm-charts-hardened/

Production

Preparing a production deployment requires a few steps.

  1. Save the following to your-values.yaml, ideally in your git repo.
global:
  openshift: false # If running on openshift, set to true
  spire:
    recommendations:
      enabled: true
    namespaces:
      create: true
    ingressControllerType: "" # If not openshift, and want to expose services, set to a supported option [ingress-nginx]
    # Update these
    clusterName: example-cluster
    trustDomain: example.org
    caSubject:
      country: ARPA
      organization: Example
      commonName: example.org
  1. If you need a non default storageClass, append the following to the spire-server section and update:
  persistence:
    storageClass: your-storage-class
  1. If your Kubernetes cluster is OpenShift based, use the output of the following command to update the trustDomain setting:
oc get cm -n openshift-config-managed  console-public -o go-template="{{ .data.consoleURL }}" | sed 's@https://@@; s/^[^.]*\.//'
  1. Find any additional values you might want to set based on the documentation below or using the examples

In particular, consider using an external database.

  1. Deploy
helm upgrade --install -n spire-mgmt spire-crds spire-crds --repo https://spiffe.github.io/helm-charts-hardened/ --create-namespace
helm upgrade --install -n spire-mgmt spire spire-nested --repo https://spiffe.github.io/helm-charts-hardened/ -f your-values.yaml

Clean up

helm -n spire-mgmt uninstall spire-crds
helm -n spire-mgmt uninstall spire
kubectl -n spire-server delete pvc -l app.kubernetes.io/instance=spire
kubectl delete crds clusterfederatedtrustdomains.spire.spiffe.io clusterspiffeids.spire.spiffe.io clusterstaticentries.spire.spiffe.io

Upgrade notes

We only support upgrading one major version at a time. Version skipping isn't supported.

0.17.X

  • If you set spire-server.replicaCount > 1, update it to 1 before upgrading and after upgrade you can set it back to its previous value.

  • The SPIFFE OIDC Discovery Provider now has many new TLS options and defaults to using SPIRE to issue its certificate.

  • The spiffe-oidc-discovery-provider.insecureScheme.enabled flag was removed. If you previously set that flag, remove the setting from your values.yaml and see if the new default of using a SPIRE issued certificate is suitable for your deployment. If it isn't, please consider one of the other options under spiffe-oidc-discovery-provider.tls. If all other options are still unsuitable, you can still enable the previous mode by disabling TLS. (spiffe-oidc-discovery-provider.tls.spire.enabled=false)

  • The SPIFFE OIDC Discovery Provider is now enabled by default. If you previously chose to have it off, you can disable it explicitly with spiffe-oidc-discovery-provider.enabled=false.

0.16.X

The settings under "spire-server.controllerManager.identities" have all been moved under "spire-server.controllerManager.identities.clusterSPIFFEIDs.default". If you have changed any from the defaults, please update them to the new location during upgrade.

0.15.X

The spire-crds chart has been updated. Please ensure you have upgraded spire-crds before upgrading the spire chart.

The chart now supports multiple parallel installs of spire-controller-manager. Each install will handle all custom resources with a matching className field. By default this is set to Release.Namespace-Release.Name and the controller manager will only pick up custom resources with this className.

If you have not loaded any SPIRE custom resources yourself, the upgrade process will be transparent. If you have loaded your own SPIRE custom resources, set spire-server.controllerManager.watchClassless=true until you can update your SPIRE custom resources to have the className for the instance specified.

0.14.X

If coming from a chart version before 0.14.0, you must relabel your crds to switch to using the new spire-crds chart. To migrate to the spire-crds chart run the following:

Replace the spire-server namespace in the commands below with the namespace you want to install the spire-crds chart in.

kubectl label crd "clusterfederatedtrustdomains.spire.spiffe.io" "app.kubernetes.io/managed-by=Helm"
kubectl annotate crd "clusterfederatedtrustdomains.spire.spiffe.io" "meta.helm.sh/release-name=spire-crds"
kubectl annotate crd "clusterfederatedtrustdomains.spire.spiffe.io" "meta.helm.sh/release-namespace=spire-server"
kubectl label crd "clusterspiffeids.spire.spiffe.io" "app.kubernetes.io/managed-by=Helm"
kubectl annotate crd "clusterspiffeids.spire.spiffe.io" "meta.helm.sh/release-name=spire-crds"
kubectl annotate crd "clusterspiffeids.spire.spiffe.io" "meta.helm.sh/release-namespace=spire-server"
kubectl label crd "controllermanagerconfigs.spire.spiffe.io" "app.kubernetes.io/managed-by=Helm"
kubectl annotate crd "controllermanagerconfigs.spire.spiffe.io" "meta.helm.sh/release-name=spire-crds"
kubectl annotate crd "controllermanagerconfigs.spire.spiffe.io" "meta.helm.sh/release-namespace=spire-server"
helm install -n spire-server spire-crds charts/spire-crds

Version support

[!Warning] This Chart is still in development and still subject to change the API (values.yaml). Until we reach a 1.0.0 version of the chart we can't guarantee backwards compatibility although we do aim for as much stability as possible.

DependencySupported Versions
Helm3.x
Kubernetes1.22+

[!Note] For Kubernetes, we will officially support the last 3 versions as described in k8s versioning. Any version before the last 3 we will try to support as long it doesn't bring security issues or any big maintenance burden.

FAQ

For any issues see our FAQ…

Usage

To utilize Spire in your own workloads you should add the following to your workload:

 apiVersion: v1
 kind: Pod
 metadata:
   name: my-app
 spec:
   containers:
     - name: my-app
       image: "my-app:latest"
       imagePullPolicy: Always
+      volumeMounts:
+        - name: spiffe-workload-api
+          mountPath: /spiffe-workload-api
+          readOnly: true
       resources:
         requests:
           cpu: 200m
           memory: 32Mi
         limits:
           cpu: 500m
           memory: 64Mi
+  volumes:
+    - name: spiffe-workload-api
+      csi:
+        driver: "csi.spiffe.io"
+        readOnly: true

Now you can interact with the Spire agent socket from your own application. The socket is mounted on /spiffe-workload-api/spire-agent.sock.

Maintainers

NameEmailUrl
marcofranssen[email protected]https://marcofranssen.nl
kfox1111[email protected]
faisal-memon[email protected]
edwbuck[email protected]

Source Code

Requirements

RepositoryNameVersion
file://./charts/spiffe-csi-driverspiffe-csi-driver0.1.0
file://./charts/spiffe-csi-driverupstream-spiffe-csi-driver(spiffe-csi-driver)0.1.0
file://./charts/spiffe-oidc-discovery-providerspiffe-oidc-discovery-provider0.1.0
file://./charts/spire-agentspire-agent0.1.0
file://./charts/spire-agentupstream-spire-agent(spire-agent)0.1.0
file://./charts/spire-serverspire-server0.1.0
file://./charts/tornjak-frontendtornjak-frontend0.1.0

Parameters

Global parameters

NameDescriptionValue
global.k8s.clusterDomainCluster domain name configured for Spire installcluster.local
global.spire.clusterNameThe name of the k8s cluster for Spire installexample-cluster
global.spire.jwtIssuerThe issuer for Spire JWT tokens. Defaults to oidc-discovery.$trustDomain if unset""
global.spire.trustDomainThe trust domain for Spire installexample.org
global.spire.caSubject.countryCountry for Spire server CA""
global.spire.caSubject.organizationOrganization for Spire server CA""
global.spire.caSubject.commonNameCommon Name for Spire server CA""
global.spire.recommendations.enabledUse recommended settings for production deployments. Default is off.false
global.spire.recommendations.namespaceLayoutSet to true to use recommended values for installing across namespacestrue
global.spire.recommendations.namespacePSSWhen chart namespace creation is enabled, label them with preffered Pod Security Standard labelstrue
global.spire.recommendations.priorityClassNameSet to true to use recommended values for Pod Priority Class Namestrue
global.spire.recommendations.strictModeCheck values, such as trustDomain, are overridden with a suitable value for production.true
global.spire.recommendations.securityContextsSet to true to use recommended values

Deploy spire-nested with OpenTenant

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