Skip to content

Commit

Permalink
[stable/aws-iam-authenticator] Add new chart (helm#10940)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Plummer <[email protected]>
  • Loading branch information
plumdog authored and k8s-ci-robot committed Feb 15, 2019
1 parent 65a1c9e commit 5586b43
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stable/aws-iam-authenticator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
11 changes: 11 additions & 0 deletions stable/aws-iam-authenticator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for aws-iam-authenticator
name: aws-iam-authenticator
version: 0.1.0
home: https://github.com/kubernetes-sigs/aws-iam-authenticator
maintainers:
- name: plumdog
email: [email protected]
sources:
- https://github.com/kubernetes-sigs/aws-iam-authenticator
36 changes: 36 additions & 0 deletions stable/aws-iam-authenticator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# AWS IAM Authenticator

See https://github.com/kubernetes-sigs/aws-iam-authenticator

In particular, make sure that have configured your API server as in
https://github.com/kubernetes-sigs/aws-iam-authenticator#how-do-i-use-it. (This
chart only installs the DaemonSet and a ConfigMap.)

## Values

| Config | Description | Default |
| `image.repository` | Image repo | `gcr.io/heptio-images/authenticator` |
| `image.tag` | Image tag | `v0.1.0` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `config` | All the config, see below | `{}` |
| `resources` | Pod resources | `{}` |
| `hostPathConfig.output` | HostPath output | `/srv/kubernetes/aws-iam-authenticator/` |
| `hostPathConfig.state` | HostPath state | `/srv/kubernetes/aws-iam-authenticator/` |

### Config

The value set for `config` is where all the action happens - this is
how you map AWS IAM roles to groups in the cluster. See the
aws-iam-authenticator docs for all of the possible options for this.

A simple example values file might look like:
```
config:
clusterID: mycluster.io
server:
mapRoles:
- groups:
- developers # the name of a group within Kubernetes
roleARN: arn:aws:iam::000000000000:role/developer # the ARN of a role in AWS
username: developer
```
32 changes: 32 additions & 0 deletions stable/aws-iam-authenticator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "aws-iam-authenticator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "aws-iam-authenticator.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "aws-iam-authenticator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
12 changes: 12 additions & 0 deletions stable/aws-iam-authenticator/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "aws-iam-authenticator.fullname" . }}
labels:
app: {{ template "aws-iam-authenticator.name" . }}
chart: {{ template "aws-iam-authenticator.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
config.yaml: |
{{ toYaml .Values.config | indent 4 }}
67 changes: 67 additions & 0 deletions stable/aws-iam-authenticator/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: {{ template "aws-iam-authenticator.fullname" . }}
labels:
app: {{ template "aws-iam-authenticator.name" . }}
chart: {{ template "aws-iam-authenticator.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
labels:
app: {{ template "aws-iam-authenticator.name" . }}
release: {{ .Release.Name }}
spec:
# run on the host network (don't depend on CNI)
hostNetwork: true

# run on each master node
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- key: CriticalAddonsOnly
operator: Exists

# run `aws-iam-authenticator server` with three volumes
# - config (mounted from the ConfigMap at /etc/aws-iam-authenticator/config.yaml)
# - state (persisted TLS certificate and keys, mounted from the host)
# - output (output kubeconfig to plug into your apiserver configuration, mounted from the host)
containers:
- name: {{ template "aws-iam-authenticator.fullname" . }}
image: gcr.io/heptio-images/authenticator:v0.1.0
args:
- server
- --config=/etc/aws-iam-authenticator/config.yaml
- --state-dir=/var/aws-iam-authenticator
- --generate-kubeconfig=/etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml

resources:
{{ toYaml .Values.resources | indent 10 }}

volumeMounts:
- name: config
mountPath: /etc/aws-iam-authenticator/
- name: state
mountPath: /var/aws-iam-authenticator/
- name: output
mountPath: /etc/kubernetes/aws-iam-authenticator/

volumes:
- name: config
configMap:
name: {{ template "aws-iam-authenticator.fullname" . }}
- name: output
hostPath:
path: {{ .Values.hostPathConfig.output }}
- name: state
hostPath:
path: {{ .Values.hostPathConfig.state }}
12 changes: 12 additions & 0 deletions stable/aws-iam-authenticator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
image:
repository: gcr.io/heptio-images/authenticator
tag: v0.1.0
pullPolicy: IfNotPresent

config: {}

resources: {}

hostPathConfig:
output: /srv/kubernetes/aws-iam-authenticator/
state: /srv/kubernetes/aws-iam-authenticator/

0 comments on commit 5586b43

Please sign in to comment.