Skip to content

Commit c69d674

Browse files
committed
add aws and kubernetes crossplane providers
Signed-off-by: Carlos Santana <[email protected]>
1 parent 8f439fc commit c69d674

21 files changed

+361
-41
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
local/
1+
local/
2+
*.tgz
3+
Chart.lock
4+
.DS_Store

charts/addons/crossplane/aws/resources/templates/aws-controller-config.yaml

-12
This file was deleted.

charts/addons/crossplane/aws/resources/templates/aws-provider-config.yaml

-12
This file was deleted.

charts/addons/crossplane/aws/resources/templates/aws-provider.yaml

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v2
2+
name: resources
3+
description: A Helm chart for Kubernetes
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: 1.0.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+
# It is recommended to use it with quotes.
24+
appVersion: "1.0.0"
25+
26+
dependencies:
27+
- name: aws
28+
version: "1.0.0"
29+
repository: "file://aws"

charts/addons/crossplane/aws/resources/Chart.yaml renamed to charts/addons/crossplane/resources/aws/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
name: resources
2+
name: aws
33
description: A Helm chart for Kubernetes
44

55
# A chart can be either an 'application' or a 'library' chart.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.global.enabled_aws .Values.controllerConfig.enabled }}
2+
{{- with .Values.controllerConfig }}
3+
apiVersion: pkg.crossplane.io/v1alpha1
4+
kind: ControllerConfig
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if .metadata.annotations }}
8+
annotations:
9+
{{- range $key, $value := .metadata.annotations }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
{{- end }}
13+
{{- if .metadata.labels }}
14+
labels:
15+
{{- range $key, $value := .metadata.labels }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
spec:
20+
{{- .spec | toYaml | nindent 2 }}
21+
{{- end }}
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.global.enabled_aws .Values.providerConfig.enabled }}
2+
{{- with .Values.providerConfig }}
3+
apiVersion: aws.crossplane.io/v1beta1
4+
kind: ProviderConfig
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if .metadata.annotations }}
8+
annotations:
9+
{{- range $key, $value := .metadata.annotations }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
{{- end }}
13+
{{- if .metadata.labels }}
14+
labels:
15+
{{- range $key, $value := .metadata.labels }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
spec:
20+
{{- .spec | toYaml | nindent 2 }}
21+
{{- end }}
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if and .Values.global.enabled_aws .Values.provider.enabled }}
2+
{{- with .Values.provider }}
3+
apiVersion: pkg.crossplane.io/v1
4+
kind: Provider
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if or $.Values.global.iam_role_arn .metadata.iam_role_arn .metadata.annotations }}
8+
annotations:
9+
{{- if or $.Values.global.iam_role_arn .metadata.iam_role_arn }}
10+
eks.amazonaws.com/role-arn: {{ default $.Values.global.iam_role_arn .metadata.role_arn }}
11+
{{- end }}
12+
{{- range $key, $value := .metadata.annotations }}
13+
{{ $key }}: {{ $value | quote }}
14+
{{- end }}
15+
{{- end }}
16+
{{- if .metadata.labels }}
17+
labels:
18+
{{- range $key, $value := .metadata.labels }}
19+
{{ $key }}: {{ $value | quote }}
20+
{{- end }}
21+
{{- end }}
22+
spec:
23+
package: {{ .package.registry }}:{{ .package.version }}
24+
controllerConfigRef:
25+
name: {{ $.Values.controllerConfig.metadata.name }}
26+
{{- end }}
27+
{{- end }}
28+

charts/addons/crossplane/aws/resources/values.yaml renamed to charts/addons/crossplane/resources/aws/values.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
controller:
1+
global:
2+
iam_role_arn: null
3+
enabled_aws: true
4+
5+
controllerConfig:
26
enabled: true
37
metadata:
48
name: "aws-controller-config"
59
annotations: {}
10+
labels: {}
611
spec:
712
podSecurityContext:
813
fsGroup: 2000
@@ -13,7 +18,9 @@ provider:
1318
enabled: true
1419
metadata:
1520
name: "aws-provider"
21+
iam_role_arn: null
1622
annotations: {}
23+
labels: {}
1724
package:
1825
registry: xpkg.upbound.io/crossplane-contrib/provider-aws
1926
version: "v0.41.1"
@@ -23,6 +30,7 @@ providerConfig:
2330
metadata:
2431
name: "aws-provider-config"
2532
annotations: {}
33+
labels: {}
2634
spec:
2735
credentials:
2836
source: InjectedIdentity
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/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: kubernetes
3+
description: A Helm chart for Kubernetes
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: 1.0.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+
# It is recommended to use it with quotes.
24+
appVersion: "1.0.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "resources.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 "resources.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 "resources.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "resources.labels" -}}
37+
helm.sh/chart: {{ include "resources.chart" . }}
38+
{{ include "resources.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 "resources.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "resources.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{- if and .Values.global.enabled_kubernetes .Values.clusterRoleBinding.enabled }}
2+
{{- with .Values.clusterRoleBinding }}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRoleBinding
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if .metadata.annotations }}
8+
annotations:
9+
{{- range $key, $value := .metadata.annotations }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
{{- end }}
13+
{{- if .metadata.labels }}
14+
labels:
15+
{{- range $key, $value := .metadata.labels }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
subjects:
20+
- kind: ServiceAccount
21+
name: {{ $.Values.controllerConfig.spec.serviceAccountName }}
22+
namespace: {{ $.Release.Namespace }}
23+
roleRef:
24+
{{- .roleRef | toYaml | nindent 2 }}
25+
{{- end }}
26+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.global.enabled_kubernetes .Values.controllerConfig.enabled }}
2+
{{- with .Values.controllerConfig }}
3+
apiVersion: pkg.crossplane.io/v1alpha1
4+
kind: ControllerConfig
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if .metadata.annotations }}
8+
annotations:
9+
{{- range $key, $value := .metadata.annotations }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
{{- end }}
13+
{{- if .metadata.labels }}
14+
labels:
15+
{{- range $key, $value := .metadata.labels }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
spec:
20+
{{- .spec | toYaml | nindent 2 }}
21+
{{- end }}
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.global.enabled_kubernetes .Values.providerConfig.enabled }}
2+
{{- with .Values.providerConfig }}
3+
apiVersion: aws.crossplane.io/v1beta1
4+
kind: ProviderConfig
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if .metadata.annotations }}
8+
annotations:
9+
{{- range $key, $value := .metadata.annotations }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
{{- end }}
13+
{{- if .metadata.labels }}
14+
labels:
15+
{{- range $key, $value := .metadata.labels }}
16+
{{ $key }}: {{ $value | quote }}
17+
{{- end }}
18+
{{- end }}
19+
spec:
20+
{{- .spec | toYaml | nindent 2 }}
21+
{{- end }}
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if and .Values.global.enabled_kubernetes .Values.provider.enabled }}
2+
{{- with .Values.provider }}
3+
apiVersion: pkg.crossplane.io/v1
4+
kind: Provider
5+
metadata:
6+
name: {{ .metadata.name }}
7+
{{- if or .metadata.annotations }}
8+
annotations:
9+
{{- if or $.Values.global.iam_role_arn .metadata.iam_role_arn }}
10+
eks.amazonaws.com/role-arn: {{ default $.Values.global.iam_role_arn .metadata.role_arn }}
11+
{{- end }}
12+
{{- range $key, $value := .metadata.annotations }}
13+
{{ $key }}: {{ $value | quote }}
14+
{{- end }}
15+
{{- end }}
16+
{{- if .metadata.labels }}
17+
labels:
18+
{{- range $key, $value := .metadata.labels }}
19+
{{ $key }}: {{ $value | quote }}
20+
{{- end }}
21+
{{- end }}
22+
spec:
23+
package: {{ .package.registry }}:{{ .package.version }}
24+
controllerConfigRef:
25+
name: {{ $.Values.controllerConfig.metadata.name }}
26+
{{- end }}
27+
{{- end }}
28+

0 commit comments

Comments
 (0)