@@ -1430,127 +1430,29 @@ Kustomization object itself, it will fall back to these defaults.
14301430
14311431See also the [workload identity](/flux/installation/configuration/workload-identity/) docs.
14321432
1433- # ### AWS KMS
1433+ # ### Cloud Provider KMS Services
14341434
1435- While making use of the [IAM OIDC provider](https://eksctl.io/usage/iamserviceaccounts/)
1436- on your EKS cluster, you can create an IAM Role and Service Account with access
1437- to AWS KMS (using at least `kms:Decrypt` and `kms:DescribeKey`). Once these are
1438- created, you can annotate the kustomize-controller Service Account with the
1439- Role ARN, granting the controller permission to decrypt the Secrets. Please refer
1440- to the [SOPS guide](https://fluxcd.io/flux/guides/mozilla-sops/#aws) for detailed steps.
1435+ For cloud provider KMS services, please refer to the specific sections in the integration guides :
14411436
1442- ` ` ` sh
1443- kubectl -n flux-system annotate serviceaccount kustomize-controller \
1444- --field-manager=flux-client-side-apply \
1445- eks.amazonaws.com/role-arn='arn:aws:iam::<ACCOUNT_ID>:role/<KMS-ROLE-NAME>'
1446- ` ` `
1437+ Service-specific configuration :
14471438
1448- Furthermore, you can also use the usual [environment variables used for specifying AWS
1449- credentials ](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html#envvars-list),
1450- by patching the kustomize-controller Deployment :
1439+ - [AWS KMS](https://fluxcd.io/flux/integrations/aws/# for-amazon-key-management-service)
1440+ - [Azure Key Vault ](https://fluxcd.io/flux/integrations/azure/#for-azure-key-vault)
1441+ - [GCP KMS](https://fluxcd.io/flux/integrations/gcp/#for-google-cloud-key-management-service)
14511442
1452- ` ` ` yaml
1453- ---
1454- apiVersion: apps/v1
1455- kind: Deployment
1456- metadata:
1457- name: kustomize-controller
1458- namespace: flux-system
1459- spec:
1460- template:
1461- spec:
1462- containers:
1463- - name: manager
1464- env:
1465- - name: AWS_ACCESS_KEY_ID
1466- valueFrom:
1467- secretKeyRef:
1468- name: aws-creds
1469- key: awsAccessKeyID
1470- - name: AWS_SECRET_ACCESS_KEY
1471- valueFrom:
1472- secretKeyRef:
1473- name: aws-creds
1474- key: awsSecretAccessKey
1475- - name: AWS_SESSION_TOKEN
1476- valueFrom:
1477- secretKeyRef:
1478- name: aws-creds
1479- key: awsSessionToken
1480- ` ` `
1481-
1482- In addition to this, the
1483- [general SOPS documentation around KMS AWS applies](https://github.com/mozilla/sops#27kms-aws-profiles),
1484- allowing you to specify e.g. a `SOPS_KMS_ARN` environment variable.
1485-
1486- **Note:**: If you are mounting a secret containing the AWS credentials as a
1487- file in the `kustomize-controller` Pod, you need to specify an environment
1488- variable `$HOME`, since the AWS credentials file is expected to be present at
1489- `~/.aws`. For example :
1490-
1491- ` ` ` yaml
1492- env:
1493- - name: HOME
1494- value: /home/{$USER}
1495- ` ` `
1443+ Controller-level configuration :
14961444
1497- # ### Azure Key Vault
1445+ - [AWS](https://fluxcd.io/flux/integrations/aws/#at-the-controller-level)
1446+ - [Azure](https://fluxcd.io/flux/integrations/azure/#at-the-controller-level)
1447+ - [GCP](https://fluxcd.io/flux/integrations/gcp/#at-the-controller-level)
14981448
1499- # #### Workload Identity
1449+ These guides provide detailed instructions for setting up authentication,
1450+ permissions, and controller configuration for each cloud provider.
15001451
1501- If you have Workload Identity set up on your AKS cluster, you can establish
1502- a federated identity between the kustomize-controller ServiceAccount and an
1503- identity that has "Decrypt" role on the Azure Key Vault. Once, this is done
1504- you can label and annotate the kustomize-controller ServiceAccount and Pod
1505- with the patch shown below :
1452+ # ### Hashicorp Vault
15061453
1507- ` ` ` yaml
1508- apiVersion: kustomize.config.k8s.io/v1beta1
1509- kind: Kustomization
1510- resources:
1511- - gotk-components.yaml
1512- - gotk-sync.yaml
1513- patches:
1514- - patch: |-
1515- apiVersion: v1
1516- kind: ServiceAccount
1517- metadata:
1518- name: kustomize-controller
1519- namespace: flux-system
1520- annotations:
1521- azure.workload.identity/client-id: <AZURE_CLIENT_ID>
1522- labels:
1523- azure.workload.identity/use: "true"
1524- - patch: |-
1525- apiVersion: apps/v1
1526- kind: Deployment
1527- metadata:
1528- name: kustomize-controller
1529- namespace: flux-system
1530- labels:
1531- azure.workload.identity/use: "true"
1532- spec:
1533- template:
1534- metadata:
1535- labels:
1536- azure.workload.identity/use: "true"
1537- ` ` `
1538-
1539- # #### Kubelet Identity
1540-
1541- If the kubelet managed identity has `Decrypt` permissions on Azure Key Vault,
1542- no additional configuration is required for the kustomize-controller to decrypt
1543- data.
1544-
1545- # ### GCP KMS
1546-
1547- While making use of Google Cloud Platform, the [`GOOGLE_APPLICATION_CREDENTIALS`
1548- environment variable](https://cloud.google.com/docs/authentication/production)
1549- is automatically taken into account.
1550- [Granting permissions](https://cloud.google.com/kms/docs/reference/permissions-and-roles)
1551- to the Service Account attached to this will therefore be sufficient to decrypt
1552- data. When running outside GCP, it is possible to manually patch the
1553- kustomize-controller Deployment with a valid set of (mounted) credentials.
1454+ To configure a global default for Hashicorp Vault, patch the controller's
1455+ Deployment with a `VAULT_TOKEN` environment variable.
15541456
15551457` ` ` yaml
15561458---
@@ -1565,41 +1467,35 @@ spec:
15651467 containers:
15661468 - name: manager
15671469 env:
1568- - name: GOOGLE_APPLICATION_CREDENTIALS
1569- value: /var/gcp/credentials.json
1570- volumeMounts:
1571- - name: gcp-credentials
1572- mountPath: /var/gcp/
1573- readOnly: true
1574- volumes:
1575- - name: gcp-credentials
1576- secret:
1577- secretName: mysecret
1578- items:
1579- - key: credentials
1580- path: credentials.json
1470+ - name: VAULT_TOKEN
1471+ value: <token>
15811472` ` `
15821473
1583- # ### Hashicorp Vault
1474+ # ### SOPS Age Keys
15841475
1585- To configure a global default for Hashicorp Vault, patch the controller's
1586- Deployment with a `VAULT_TOKEN` environment variable.
1476+ To configure global decryption for SOPS Age keys, use the `--sops-age-secret`
1477+ controller flag to specify a Kubernetes Secret containing the Age private keys.
1478+
1479+ Start the kustomize-controller with the flag :
1480+
1481+ ` ` ` sh
1482+ --sops-age-secret=<secret-name>
1483+ ` ` `
1484+
1485+ The referenced Secret must be in the same namespace as the kustomize-controller
1486+ (specified in the `RUNTIME_NAMESPACE` environment variable) and contain Age
1487+ private keys with the `.agekey` suffix :
15871488
15881489` ` ` yaml
15891490---
1590- apiVersion: apps/ v1
1591- kind: Deployment
1491+ apiVersion: v1
1492+ kind: Secret
15921493metadata:
1593- name: kustomize-controller
1494+ name: sops-age-keys
15941495 namespace: flux-system
1595- spec:
1596- template:
1597- spec:
1598- containers:
1599- - name: manager
1600- env:
1601- - name: VAULT_TOKEN
1602- value: <token>
1496+ data:
1497+ identity1.agekey: <BASE64>
1498+ identity2.agekey: <BASE64>
16031499` ` `
16041500
16051501# ## Kustomize secretGenerator
0 commit comments