-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from EDITD/PFM_615_Add_aws_secret_store_settings
PFM-615 / Add support to specify to ServiceAccount and SecretProviderClass
- Loading branch information
Showing
14 changed files
with
290 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def make_secret_volume_config(name, secret): | ||
volume_data = { | ||
'name': name, | ||
'csi': { | ||
'driver': 'secrets-store.csi.k8s.io', | ||
'readOnly': True, | ||
'volumeAttributes': { | ||
'secretProviderClass': secret['secretProviderClass'], | ||
}, | ||
}, | ||
} | ||
|
||
return volume_data |
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ deployments: | |
httpGet: | ||
path: /ping | ||
|
||
|
||
cronjobs: | ||
generic-cronjob: | ||
schedule: "*/1 * * * *" | ||
|
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,50 @@ | ||
kind: CronJob | ||
metadata: | ||
name: generic-cronjob | ||
labels: { | ||
kubetools/name: generic-cronjob, | ||
kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: cronjob | ||
} | ||
annotations: { | ||
app.kubernetes.io/managed-by: kubetools, | ||
description: 'Run: [''generic-command'']' | ||
} | ||
spec: | ||
schedule: "*/1 * * * *" | ||
startingDeadlineSeconds: 10 | ||
concurrencyPolicy: "Allow" | ||
jobTemplate: | ||
spec: | ||
template: | ||
metadata: | ||
name: generic-cronjob | ||
labels: { | ||
kubetools/name: generic-cronjob, | ||
kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: cronjob | ||
} | ||
annotations: { | ||
app.kubernetes.io/managed-by: kubetools, | ||
description: 'Run: [''generic-command'']' | ||
} | ||
spec: | ||
serviceAccountName: generic-account | ||
containers: | ||
- command: [generic-command] | ||
containerContext: generic-context | ||
env: | ||
- {name: KUBE, value: 'true'} | ||
image: generic-image | ||
imagePullPolicy: 'Always' | ||
name: generic-container | ||
volumeMounts: | ||
- {name: secret-volume, mountPath: /mnt/cronjobs-secrets-store, readonly: True} | ||
restartPolicy: OnFailure | ||
volumes: | ||
- name: secret-volume | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: secrets |
75 changes: 75 additions & 0 deletions
75
tests/configs/k8s_with_mounted_secrets/k8s_deployments.yml
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,75 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: {app.kubernetes.io/managed-by: kubetools} | ||
labels: {kubetools/name: generic-app-with-secrets-generic-deployment-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: app} | ||
name: generic-app-with-secrets-generic-deployment-with-secrets | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 5 | ||
selector: | ||
matchLabels: {kubetools/name: generic-app-with-secrets-generic-deployment-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: app} | ||
template: | ||
metadata: | ||
labels: {kubetools/name: generic-app-with-secrets-generic-deployment-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: app} | ||
spec: | ||
serviceAccountName: web-api | ||
containers: | ||
- command: [generic-command] | ||
containerContext: generic-context | ||
env: | ||
- {name: KUBE, value: 'true'} | ||
image: generic-image | ||
imagePullPolicy: Always | ||
name: generic-deployment-workers | ||
volumeMounts: | ||
- {name: secret-volume, mountPath: /mnt/secrets-store, readonly: True} | ||
volumes: | ||
- name: secret-volume | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: secrets | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: {app.kubernetes.io/managed-by: kubetools} | ||
labels: {kubetools/name: generic-app-with-secrets-generic-dependency-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: dependency} | ||
name: generic-app-with-secrets-generic-dependency-with-secrets | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 5 | ||
selector: | ||
matchLabels: {kubetools/name: generic-app-with-secrets-generic-dependency-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: dependency} | ||
template: | ||
metadata: | ||
labels: {kubetools/name: generic-app-with-secrets-generic-dependency-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: dependency} | ||
spec: | ||
serviceAccountName: web-api | ||
containers: | ||
- command: [generic-command] | ||
containerContext: generic-context | ||
env: | ||
- {name: KUBE, value: 'true'} | ||
image: generic-image | ||
imagePullPolicy: Always | ||
name: generic-dependency | ||
volumeMounts: | ||
- {name: secret-volume, mountPath: /mnt/secrets-store, readonly: True} | ||
volumes: | ||
- name: secret-volume | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: secrets |
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,27 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: {app.kubernetes.io/managed-by: kubetools} | ||
labels: {kubetools/name: generic-app-with-secrets-generic-deployment-with-secrets, kubetools/project_name: generic-app-with-secrets, kubetools/role: app} | ||
name: generic-app-with-secrets-generic-deployment-with-secrets | ||
spec: | ||
ports: | ||
- {port: 80, targetPort: 80} | ||
selector: {kubetools/name: generic-app-with-secrets-generic-deployment-with-secrets, kubetools/project_name: generic-app-with-secrets, kubetools/role: app} | ||
type: NodePort | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: {app.kubernetes.io/managed-by: kubetools} | ||
labels: {kubetools/name: generic-app-with-secrets-generic-dependency-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: dependency} | ||
name: generic-app-with-secrets-generic-dependency-with-secrets | ||
spec: | ||
ports: | ||
- {port: 80, targetPort: 80} | ||
selector: {kubetools/name: generic-app-with-secrets-generic-dependency-with-secrets, kubetools/project_name: generic-app-with-secrets, | ||
kubetools/role: dependency} | ||
type: NodePort |
Oops, something went wrong.