Updated mnist example README with AWS credentials setting

This commit is contained in:
Oleg Shepetyuk 2019-01-25 17:26:56 +02:00
parent f85a8e970f
commit ea86a41172
1 changed files with 28 additions and 25 deletions

View File

@ -354,20 +354,20 @@ various environment variables configuring access to S3.
--from-literal=awsSecretAccessKey=${AWS_SECRET_ACCESS_KEY} --from-literal=awsSecretAccessKey=${AWS_SECRET_ACCESS_KEY}
``` ```
1. Mount the secret into the pod 1. Pass secrets as environment variables into pod
``` ```
ks param set --env=${KSENV} train secret aws-creds=/var/secrets ks param set --env=${KSENV} train secretKeyRefs AWS_ACCESS_KEY_ID=aws-creds.awsAccessKeyID,AWS_SECRET_ACCESS_KEY=aws-creds.awsSecretAccessKey
``` ```
* Setting this ksonnet parameter causes a volumeMount and volume to be added to your TFJob * Setting this ksonnet parameter causes a two new environment variables to be added to your TFJob
* To see this you can run * To see this you can run
``` ```
ks show ${KSENV} -c train ks show ${KSENV} -c train
``` ```
* The output should now include a volumeMount and volume section * The output should now include two environment variables referencing K8s secret
``` ```
apiVersion: kubeflow.org/v1beta1 apiVersion: kubeflow.org/v1beta1
@ -384,15 +384,18 @@ spec:
containers: containers:
- command: - command:
... ...
volumeMounts: env:
- mountPath: /var/secrets
name: aws-creds
readOnly: true
... ...
volumes: - name: AWS_ACCESS_KEY_ID
- name: aws-creds valueFrom:
secret: secretKeyRef:
secretName: aws-creds key: awsAccessKeyID
name: aws-creds
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
key: awsSecretAccessKey
name: aws-creds
... ...
``` ```