stable/kube2iam: added support for aws access keys (#2675)

Added a secret resource to allow setting AWS access keys and region
This commit is contained in:
Jesus Rafael Carrillo
2017-11-09 12:36:19 -06:00
committed by Michael Goodness
parent 442cc3c5c5
commit e601cef6eb
4 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: kube2iam
version: 0.6.0
version: 0.6.1
description: Provide IAM credentials to pods based on annotations.
keywords:
- kube2iam
+16
View File
@@ -42,6 +42,22 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if and .Values.aws.secret_key .Values.aws.access_key }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ template "kube2iam.fullname" . }}
key: aws_access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ template "kube2iam.fullname" . }}
key: aws_secret_access_key
{{- end }}
{{- if .Values.aws.region }}
- name: AWS_DEFAULT_REGION
value: {{ .Values.aws.region }}
{{- end }}
ports:
- containerPort: 8181
resources:
+15
View File
@@ -0,0 +1,15 @@
{{- if and .Values.aws.secret_key .Values.aws.access_key -}}
apiVersion: v1
kind: Secret
metadata:
labels:
app: {{ template "kube2iam.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "kube2iam.fullname" . }}
type: Opaque
data:
aws_access_key_id: {{ .Values.aws.access_key | b64enc | quote }}
aws_secret_access_key: {{ .Values.aws.secret_key | b64enc | quote }}
{{- end }}
+6
View File
@@ -14,6 +14,12 @@ image:
tag: 0.7.0
pullPolicy: IfNotPresent
# AWS Access keys to inject as environment variables
aws:
secret_key: ""
access_key: ""
region: ""
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##