-
-
Notifications
You must be signed in to change notification settings - Fork 393
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 #27 from commjoen/feature/secretsmanager
- Loading branch information
Showing
12 changed files
with
177 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: secret-challenge | ||
name: secret-challenge | ||
namespace: default | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: secret-challenge | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 25% | ||
maxUnavailable: 25% | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
creationTimestamp: "2020-10-28T20:21:04Z" | ||
labels: | ||
app: secret-challenge | ||
name: secret-challenge | ||
spec: | ||
serviceAccountName: vault | ||
volumes: | ||
- name: secrets-store-inline | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: "wrongsecrets-aws-secretsmanager" | ||
containers: | ||
- image: jeroenwillemsen/addo-example:0.0.2-k8s-vault | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
name: secret-challenge | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
env: | ||
- name: SPECIAL_K8S_SECRET | ||
valueFrom: | ||
configMapKeyRef: | ||
name: secrets-file | ||
key: funny.entry | ||
- name: SPECIAL_SPECIAL_K8S_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: funnystuff | ||
key: funnier | ||
- name: VAULT_ADDR | ||
value: "http://vault:8200" | ||
- name: JWT_PATH | ||
value: "/var/run/secrets/kubernetes.io/serviceaccount/token" | ||
volumeMounts: | ||
- name: secrets-store-inline | ||
mountPath: "/mnt/secrets-store" | ||
readOnly: true | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 |
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,12 @@ | ||
apiVersion: secrets-store.csi.x-k8s.io/v1alpha1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: wrongsecrets-aws-secretsmanager | ||
spec: | ||
provider: aws | ||
parameters: | ||
objects: | | ||
- objectName: "wrongsecret" | ||
objectType: "secretsmanager" | ||
- objectName: "wrongsecret-2" | ||
objectType: "secretsmanager" |
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,3 @@ | ||
=== Challenge 10: AWS Secrets manager part 2 | ||
|
||
The AWS secret is now randomized and stored directly in secrets manager. We're still mounting it to the K8s pod via the https://docs.aws.amazon.com/secretsmanager/latest/userguide/integrating_csi_driver.html[CSI driver] though... Can you access it? |
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,3 @@ | ||
=== Challenge 9: AWS Secrets manager part 1 | ||
|
||
Okay, now we're generating an AWS secret through Terraform. What happens in the Terraform state? |
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