-
Notifications
You must be signed in to change notification settings - Fork 393
[New] External Secret Operator with Secret Manager #8653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
b4038db
c41a3c4
0d3d6bc
36b3fd8
d11fd63
08fccab
400ac30
2a2ab17
c5d472c
ddad50b
ff6bb79
5d3a23d
635cac5
2fb08a7
86bad73
c4f11a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,194 @@ | ||||||||||||
| --- | ||||||||||||
| title: "Use Kubernetes External Secret Operator with Secret Manager" | ||||||||||||
| excerpt: "Configure External Secret Operator to store Kubernetes secrets on the OVHcloud Secret Manager" | ||||||||||||
| updated: 2025-11-07 | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| > [!primary] | ||||||||||||
| > Secret Manager is currently in beta phase. This guide can be updated in the future with the advances of our teams in charge of this product. | ||||||||||||
|
|
||||||||||||
| ## Objective | ||||||||||||
|
|
||||||||||||
| This guide explains how to set up the Kubernetes External Secret Operator to use the OVHcloud Secret Manager as a provider. | ||||||||||||
|
|
||||||||||||
| ## Requirements | ||||||||||||
|
|
||||||||||||
| - An [OVHcloud customer account](/pages/account_and_service_management/account_information/ovhcloud-account-creation). | ||||||||||||
| - Have [ordered an OKMS domain](/pages/manage_and_operate/kms/quick-start) or [created a first secret](/pages/manage_and_operate/secret_manager/secret-manager-ui). | ||||||||||||
| - Have a Kubernetes cluster. | ||||||||||||
|
|
||||||||||||
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
| ## Instructions | ||||||||||||
|
|
||||||||||||
| ### Setup the Secret Manager | ||||||||||||
|
|
||||||||||||
| To allow access to the Secret Manager you will need to create credentials. | ||||||||||||
|
|
||||||||||||
| Create an [IAM local user](/pages/account_and_service_management/account_information/ovhcloud-users-management) with access right on your domain. | ||||||||||||
scraly marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| The user should be a member of a group with the ADMIN role, or if using [IAM policies](/pages/account_and_service_management/account_information/iam-policy-ui) to have at least the following rights on the OKMS domain: | ||||||||||||
|
|
||||||||||||
| - `okms:apikms:secret/create` | ||||||||||||
| - `okms:apikms:secret/version/getData` | ||||||||||||
| - `okms:apiovh:secret/get` | ||||||||||||
|
|
||||||||||||
| Then create a Personnal Acces Token (PAT) `user_pat`: | ||||||||||||
|
|
||||||||||||
| > [!api] | ||||||||||||
| > | ||||||||||||
| > @api {v1} /me POST /me/identity/user/{user}/token | ||||||||||||
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||
|
|
||||||||||||
| API will answer with: | ||||||||||||
|
|
||||||||||||
| ```json | ||||||||||||
| { | ||||||||||||
| "creation": "2025-11-13T10:38:44.658926311Z", | ||||||||||||
| "description": "my first PAT", | ||||||||||||
| "expiresAt": null, | ||||||||||||
| "lastUsed": null, | ||||||||||||
| "name": "my_PAT", | ||||||||||||
| "token": "eyJhbGciOiJFZERXXXXXXXXDyI23Q7euIDmw9Pn__SDA" | ||||||||||||
| } | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Keep safe the value of `token` field as it will never be prompt again and will be used to authenticate on the Secret Manager as `user_pat`. | ||||||||||||
|
|
||||||||||||
| You will also need the `okms-id` of the OKMS domain you want to use. This ID can be found on the OVHcloud Control Panel. | ||||||||||||
|
||||||||||||
| You will also need the `okms-id` of the OKMS domain you want to use. This ID can be found on the OVHcloud Control Panel. | |
| You will also need the `region` and the `okms-id` of the OKMS domain you want to use. This ID and this region can be found on the OVHcloud Control Panel. | |
| Or through the `ovhcloud` CLI: | |
$ ovhcloud okms list
┌──────────────────────────────────────┬─────────────┐
│ id │ region │
├──────────────────────────────────────┼─────────────┤
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ eu-west-par │
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ eu-west-par │
└──────────────────────────────────────┴─────────────┘
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas necessaire, montrer comment faire sans creation d'un secret)
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| First, install the controller in your cluster. It will automatically decrypt Sealed Secrets into standard Kubernetes Secrets | |
| First, install the controller in your cluster. It will automatically decrypt Sealed Secrets into standard Kubernetes Secrets |
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
scraly marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create the SealedSecret in your cluster:
kubectl apply -f sealedsecret.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| server: "https://{region}.okms.ovh.net/api/<okms_id>" # OKMS endpoint, fill with the correct region and your okms_id | |
| server: "https://<region>.okms.ovh.net/api/<okms_id>" # OKMS endpoint, fill with the correct region and your okms_id |
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Show resolved
Hide resolved
gbarideau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,195 @@ | ||||||||||||||
| --- | ||||||||||||||
| title: "Utiliser Kubernetes External Secret Operator avec Secret Manager" | ||||||||||||||
| excerpt: "Configurer External Secret Operator pour stocker des secrets Kubernetes sur le Secret Manager OVHcloud" | ||||||||||||||
| updated: 2025-11-07 | ||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| > [!primary] | ||||||||||||||
| > Le Secret Manager est actuellement en phase bêta. Ce guide est susceptible d’être mis à jour ultérieurement avec les avancées de nos équipes en charge de ce produit. | ||||||||||||||
| > | ||||||||||||||
|
|
||||||||||||||
| ## Objectif | ||||||||||||||
|
|
||||||||||||||
| Ce guide explique comment configurer le Kubernetes External Secret Operator pour utiliser le Secret Manager OVHcloud comme fournisseur | ||||||||||||||
|
|
||||||||||||||
| ## Prérequis | ||||||||||||||
|
|
||||||||||||||
| - Un [compte client OVHcloud](/pages/account_and_service_management/account_information/ovhcloud-account-creation). | ||||||||||||||
| - Avoir [commandé un domaine OKMS](/pages/manage_and_operate/kms/quick-start) ou [créé un premier secret](/pages/manage_and_operate/secret_manager/secret-manager-ui). | ||||||||||||||
| - Avoir un cluster Kubernetes. | ||||||||||||||
|
|
||||||||||||||
| ## En pratique | ||||||||||||||
|
|
||||||||||||||
| ### Configuration du Secret Manager | ||||||||||||||
|
|
||||||||||||||
| Pour permettre l'accès au Secret Manager, vous devrez créer des identifiants. | ||||||||||||||
|
|
||||||||||||||
| Créez un [utilisateur local IAM](/pages/account_and_service_management/account_information/ovhcloud-users-management) avec les droits d'accès à votre domaine. | ||||||||||||||
|
|
||||||||||||||
| Cet utilisateur doit être membre d'un groupe avec le role ADMIN, ou si vous utilisez les [politiques IAM](/pages/account_and_service_management/account_information/iam-policy-ui) avoir au moins les droits suivants sur le domaine OKMS : | ||||||||||||||
|
|
||||||||||||||
| - `okms:apikms:secret/create` | ||||||||||||||
| - `okms:apikms:secret/version/getData` | ||||||||||||||
| - `okms:apiovh:secret/get` | ||||||||||||||
|
|
||||||||||||||
| Puis créez un jeton d'accès personnel (PAT) `user_pat` : | ||||||||||||||
|
|
||||||||||||||
| > [!api] | ||||||||||||||
| > | ||||||||||||||
| > @api {v1} /me POST /me/identity/user/{user}/token | ||||||||||||||
|
|
||||||||||||||
| L'API va répondre : | ||||||||||||||
|
|
||||||||||||||
| ```json | ||||||||||||||
| { | ||||||||||||||
| "creation": "2025-11-13T10:38:44.658926311Z", | ||||||||||||||
| "description": "my first PAT", | ||||||||||||||
| "expiresAt": null, | ||||||||||||||
| "lastUsed": null, | ||||||||||||||
| "name": "my_PAT", | ||||||||||||||
| "token": "eyJhbGciOiJFZERXXXXXXXXDyI23Q7euIDmw9Pn__SDA" | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Gardez en sécurité la valeur du champ `token` car il ne sera jamais réaffiché et sera utilisé pour l'authentification sur le Secret Manager comme `user_pat`. | ||||||||||||||
|
|
||||||||||||||
| Vous aurez également besoin de l'`okms-id` du domaine OKMS que vous souhaitez utiliser. Cet ID peut être trouvé sur l'espace client OVHcloud. | ||||||||||||||
|
|
||||||||||||||
| ### Configuration de Sealed Secret (optionnel) | ||||||||||||||
|
|
||||||||||||||
| Sealed Secret vous permet de stocker en toute sécurité des Secrets Kubernetes là où vous le souhaitez en les chiffrant. | ||||||||||||||
| Cette étape est optionnelle mais fortement recommandée. | ||||||||||||||
|
|
||||||||||||||
| Tout d'abord, installez le contrôleur dans votre cluster. Il déchiffrera automatiquement les Sealed Secrets en Secrets Kubernetes standards | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets | ||||||||||||||
| helm install sealed-secrets -n kube-system sealed-secrets/sealed-secrets | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Puis, installez la cli kubeseal pour chiffrer des Secrets en Sealed Secrets | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| KUBESEAL_VERSION='' # Définissez ceci sur, par exemple, KUBESEAL_VERSION='0.23.0' | ||||||||||||||
| curl -OL "https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VERSION:?}/kubeseal-${KUBESEAL_VERSION:?}-linux-amd64.tar.gz" | ||||||||||||||
| tar -xvzf kubeseal-${KUBESEAL_VERSION:?}-linux-amd64.tar.gz kubeseal | ||||||||||||||
| sudo install -m 755 kubeseal /usr/local/bin/kubeseal | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Plus d'informations : (<https://github.com/bitnami-labs/sealed-secrets>) | ||||||||||||||
|
|
||||||||||||||
| ### Configuration du Secret Provider dans Kubernetes | ||||||||||||||
|
|
||||||||||||||
| #### Installez l'External Secret Operator sur votre Kubernetes | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| helm repo add external-secrets https://charts.external-secrets.io | ||||||||||||||
| helm repo update | ||||||||||||||
|
|
||||||||||||||
| helm install external-secrets \ | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| external-secrets/external-secrets \ | ||||||||||||||
|
||||||||||||||
| external-secrets/external-secrets \ |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| -n external-secrets \ |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| --create-namespace \ |
Uh oh!
There was an error while loading. Please reload this page.