Skip to content

Commit 0e4819c

Browse files
authored
Merge pull request #3 from we-dcode/feature/chart
Adding a Helm chart!
2 parents 15c25fe + 60c654a commit 0e4819c

File tree

13 files changed

+341
-24
lines changed

13 files changed

+341
-24
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ repos:
1010
- id: check-merge-conflict
1111
- id: check-symlinks
1212
- id: check-toml
13-
- id: check-yaml
13+
# Commented out the check-yaml hook because it seems that it doesn't parse the Helm templates successfully.
14+
# - id: check-yaml
1415
- id: end-of-file-fixer
1516
- id: mixed-line-ending
1617
- id: no-commit-to-branch

.vscode/launch.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v2
2+
name: aws_auth_operator
3+
description: A Helm chart for Kubernetes
4+
icon: https://avatars.githubusercontent.com/u/114700116?s=200&v=4
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
appVersion: 1.16.0
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: iamidentitymappings.iamauthenticator.k8s.aws
5+
spec:
6+
group: iamauthenticator.k8s.aws
7+
names:
8+
categories:
9+
- all
10+
kind: IAMIdentityMapping
11+
plural: iamidentitymappings
12+
singular: iamidentitymapping
13+
scope: Cluster
14+
versions:
15+
- name: v1alpha1
16+
schema:
17+
openAPIV3Schema:
18+
properties:
19+
spec:
20+
oneOf:
21+
- required:
22+
- userarn
23+
- username
24+
- required:
25+
- rolearn
26+
- username
27+
properties:
28+
groups:
29+
items:
30+
type: string
31+
type: array
32+
rolearn:
33+
type: string
34+
userarn:
35+
type: string
36+
username:
37+
type: string
38+
type: object
39+
type: object
40+
served: true
41+
storage: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AWS Auth Operator by Dcode.tech
2+
3+
_____ _ _ _
4+
| __ \ | | | | | |
5+
| | | | ___ ___ __| | ___ | |_ ___ ___| |__
6+
| | | |/ __/ _ \ / _` |/ _ \| __/ _ \/ __| '_ \
7+
| |__| | (_| (_) | (_| | __/| || __/ (__| | | |
8+
|_____/ \___\___/ \__,_|\___(_)__\___|\___|_| |_|
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "aws_auth_operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "aws_auth_operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "aws_auth_operator.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "aws_auth_operator.labels" -}}
37+
helm.sh/chart: {{ include "aws_auth_operator.chart" . }}
38+
{{ include "aws_auth_operator.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "aws_auth_operator.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "aws_auth_operator.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "aws_auth_operator.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "aws_auth_operator.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: auth-operator-role-cluster
5+
rules:
6+
# Framework: knowing which other operators are running (i.e. peering).
7+
- apiGroups: [zalando.org]
8+
resources: [kopfpeerings, clusterkopfpeerings]
9+
verbs: [list, watch, patch, get]
10+
11+
# Framework: posting the events about the handlers progress/errors.
12+
- apiGroups: [events.k8s.io]
13+
resources: [events]
14+
verbs: [create]
15+
- apiGroups: [""]
16+
resources: [events]
17+
verbs: [create]
18+
19+
# Application: watching & handling for the custom resource we declare.
20+
- apiGroups: [iamauthenticator.k8s.aws]
21+
resources: [iamidentitymappings]
22+
verbs: [list, watch, patch, get]
23+
24+
- apiGroups: [apiextensions.k8s.io]
25+
resources: [customresourcedefinitions]
26+
verbs: [list, get, update, create, patch]
27+
28+
- apiGroups:
29+
- ""
30+
resources:
31+
- configmaps
32+
verbs:
33+
- get
34+
- patch
35+
- update
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: auth-operator-rolebinding-cluster
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: auth-operator-role-cluster
9+
subjects:
10+
- kind: ServiceAccount
11+
name: {{ include "aws_auth_operator.serviceAccountName" . }}
12+
namespace: {{ .Values.namespace }}

0 commit comments

Comments
 (0)