Skip to content

Commit

Permalink
Updated mnist example README with AWS credentials setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Shepetyuk committed Jan 25, 2019
1 parent f85a8e9 commit ea86a41
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions mnist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,47 +354,50 @@ various environment variables configuring access to S3.
--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
```
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
kind: TFJob
metadata:
...
spec:
tfReplicaSpecs:
Chief:
...
template:
apiVersion: kubeflow.org/v1beta1
kind: TFJob
metadata:
...
spec:
containers:
- command:
tfReplicaSpecs:
Chief:
...
volumeMounts:
- mountPath: /var/secrets
name: aws-creds
readOnly: true
template:
...
volumes:
- name: aws-creds
secret:
secretName: aws-creds
...
```
spec:
containers:
- command:
...
env:
...
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
key: awsAccessKeyID
name: aws-creds
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
key: awsSecretAccessKey
name: aws-creds
...
```
1. Next we need to set a whole bunch of S3 related environment variables so that TensorFlow
knows how to talk to S3
Expand Down

0 comments on commit ea86a41

Please sign in to comment.