generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Workload Identity as an auth mechanism
- Loading branch information
1 parent
8d6041e
commit 36f5811
Showing
185 changed files
with
3,507 additions
and
1,292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# OCI Secrets Store CSI Driver Provider | ||
# | ||
# Copyright (c) 2022 Oracle America, Inc. and its affiliates. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ | ||
# | ||
|
||
# This Deployment is used as a reference example of how to mount secrets into the pod | ||
# via Secrets Store CSI Driver and OCI Vault Provider. | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx | ||
namespace: workload | ||
labels: | ||
app: nginx | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
serviceAccountName: workload-sa | ||
automountServiceAccountToken: true | ||
containers: | ||
- name: nginx | ||
image: nginx:1.21.4-alpine | ||
ports: | ||
- containerPort: 80 | ||
resources: | ||
limits: | ||
memory: 128Mi | ||
cpu: 200m | ||
volumeMounts: | ||
- name: 'some-creds' | ||
mountPath: '/mnt/secrets-store' # here are mounted secrets | ||
readOnly: true | ||
volumes: | ||
- name: some-creds | ||
csi: | ||
driver: 'secrets-store.csi.k8s.io' | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: 'test-oci-provider-class' # here we reference particular SecretProviderClass |
39 changes: 39 additions & 0 deletions
39
deploy/example/workload/workload-secret-provider-class.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# OCI Secrets Store CSI Driver Provider | ||
# | ||
# Copyright (c) 2022 Oracle America, Inc. and its affiliates. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ | ||
# | ||
|
||
# SecretProviderClass is a custom resource to provide driver configurations and | ||
# provider-specific parameters to the CSI driver. | ||
# | ||
# On pod start and restart, the driver will communicate with the provider to retrieve the secret content | ||
# from the external Secrets Store you have specified in the SecretProviderClass resource. | ||
# | ||
# For more information check: https://secrets-store-csi-driver.sigs.k8s.io/getting-started/usage.html | ||
# | ||
# This SecretProviderClass is used as a reference example of how to configure the OCI Vault provider. | ||
# Each SecretProviderClass enumerates secrets to mount into the pod. | ||
# So, multiple SecretProviderClass resources could exist in a single Kubernetes cluster. | ||
|
||
apiVersion: secrets-store.csi.x-k8s.io/v1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: test-oci-provider-class # SecretProviderClass name is referenced from pod definition | ||
namespace: workload | ||
spec: | ||
provider: oci # `provider` value is used as the provider socket name, must be constant | ||
parameters: | ||
# Each secret could be identified with `name` and either `stage` or `versionNumber`. | ||
# If both `stage` and `versionNumber` are omitted, default stage CURRENT is used. | ||
# Secret names could not be duplicated, since `name` field is used as a file name during the mounting. | ||
secrets: | | ||
- name: Secret-1 | ||
stage: CURRENT | ||
- name: Secret-2 | ||
versionNumber: 1 | ||
fileName: src-db-password | ||
vaultId: ocid1.vault.oc1.phx.efszzxxbaabz6.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | ||
authType: workload # possible values are: user, instance, workload | ||
authSecretName: oci-config # required if authType is user and this value refers secret name contains user credentials for auth against vault |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# OCI Secrets Store CSI Driver Provider | ||
# | ||
# Copyright (c) 2022 Oracle America, Inc. and its affiliates. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ | ||
# | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: workload | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: workload-sa | ||
namespace: workload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.