Skip to content

Commit

Permalink
build: adding aws-auth configMap provisioning into chart (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinas-b authored Oct 3, 2023
1 parent 5efcde2 commit 6acdd30
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ REVISION: 1
TEST SUITE: None
```

[work-in-progress]

### Authentication

For this tool to be able to authenticate with AWS (required when translating PermissionSet name to role ARN) it is recommended to use [AWS IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html), however any authentication methos it supported (you can also add `~/.aws/config` or `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables.
4 changes: 2 additions & 2 deletions chart/aws-iam-authenticator-sso-wrapper/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: aws-iam-authenticator-sso-wrapper
description: aws-iam-authenticator-sso-wrapper Chart
apiVersion: v2
appVersion: "v0.0.13"
version: v0.0.14
appVersion: v0.0.13
version: v0.0.15
home: https://github.com/justinas-b/aws-iam-authenticator-sso-wrapper
maintainers:
- name: justinas-b
Expand Down
21 changes: 21 additions & 0 deletions chart/aws-iam-authenticator-sso-wrapper/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ .Chart.Name }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Values.deployment.image.tag }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/component: app
app.kubernetes.io/managed-by: helm
name: {{ .Values.deployment.applicationArguments.srcConfigmap }}
namespace: {{ .Release.Namespace }}
data:
{{- with .Values.sourceConfigmap }}
{{- toYaml . | nindent 2 }}
{{- end }}
---
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Chart.Name }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand Down
23 changes: 16 additions & 7 deletions chart/aws-iam-authenticator-sso-wrapper/values.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
---
deployment:
replicas: 1

podLabels:
environment: "test"

podAnnotations:
environment: "test"

# imagePullSecrets:
# - name: myImagePullSecret

image:
repository: justinasb/aws-iam-authenticator-sso-wrapper
tag: v0.0.13
pullPolicy: IfNotPresent

resources:
limits:
cpu: "200m"
memory: "128Mi"
requests:
cpu: "100m"
memory: "64Mi"

applicationArguments:
dstNamespace: kube-system
dstConfigmap: aws-auth
debug: true
interval: 1800
srcConfigmap: aws-auth

serviceaccount:
labels:
environment: "test"
annotations:
eks.amazonaws.com/role-arn: "arn:aws:iam::123456789012:role/my-iam-role"
sourceConfigmap:
mapAccounts: |
[]
mapUsers: |
[]
mapRoles: |
- "groups":
- "system:masters"
"rolearn": "arn:aws:iam::000000000000:role/AWSReservedSSO_AdminRole_0123456789abcdef"
"username": "AdminRole:{{SessionName}}"
- "groups":
- "system:bootstrappers"
- "system:nodes"
- "system:masters"
"permissionset": "SRE"
"username": "SRE:{{SessionName}}"
---

0 comments on commit 6acdd30

Please sign in to comment.