External Secrets Operator integrates with Yandex Certificate Manager for secret management.
At the moment, authorized key authentication is only supported:
bash
yc iam service-account create --name eso-service-account
authorized-key.json file:
bash
yc iam key create \
--service-account-name eso-service-account \
--output authorized-key.json
bash
kubectl create secret generic yc-auth --from-file=authorized-key=authorized-key.json
yc-auth k8s secret:
yaml
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: secret-store
spec:
provider:
yandexcertificatemanager:
auth:
authorizedKeySecretRef:
name: yc-auth
key: authorized-key
NOTE: In case of a ClusterSecretStore, Be sure to provide namespace in all authorizedKeySecretRef with the namespace where the secret resides.
To make External Secrets Operator sync a k8s secret with a Certificate Manager certificate:
certificate-manager.certificates.downloader role
for accessing the certificate content to the service account used for authentication (***** is the certificate ID):
bash
yc cm certificate add-access-binding \
--id ***** \
--service-account-name eso-service-account \
--role certificate-manager.certificates.downloader
Run the following command to ensure that the correct access binding has been added:
bash
yc cm certificate list-access-bindings --id *****
secret-store and the certificate in Certificate Manager:
```yaml
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: external-secret
spec:
refreshInterval: 1h
secretStoreRef:
name: secret-store
kind: SecretStore
target:
name: k8s-secret # the target k8s secret name
template:
type: kubernetes.io/tls
data:
chain – to fetch PEM-encoded certificate chainprivateKey – to fetch PEM-encoded private keychainAndPrivateKey or missing property – to fetch both chain and private keyThe operator will fetch the Yandex Certificate Manager certificate and inject it as a Kind=Secret
kubectl get secret k8s-secret -ojson | jq '."data"."tls.crt"' -r | base64 --decode
kubectl get secret k8s-secret -ojson | jq '."data"."tls.key"' -r | base64 --decode