This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch gha-arc-rebase
in repository https://gitbox.apache.org/repos/asf/airflow-ci-infra.git

commit bae0d52094fafab32f7642630bc97500e5c072b3
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Jul 20 20:39:28 2023 +0200

    Create a simple chart to manage cluster resources and install cert-manager
---
 helm/cluster-config/Chart.yaml                     |  6 +++
 helm/cluster-config/templates/_helpers.tpl         | 43 ++++++++++++++++++++++
 .../cluster-config/templates/namespaces/infra.yaml |  6 +++
 helm/cluster-config/values.yaml                    |  1 +
 helm/helmfile.yaml                                 | 17 +++++++++
 helm/values/cert-manager.yaml                      |  3 ++
 6 files changed, 76 insertions(+)

diff --git a/helm/cluster-config/Chart.yaml b/helm/cluster-config/Chart.yaml
new file mode 100644
index 0000000..e4a7e18
--- /dev/null
+++ b/helm/cluster-config/Chart.yaml
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: cluster-config
+description: A Helm chart to manage the EKS cluster
+type: application
+version: 0.1.0
+appVersion: "1.16.0"
diff --git a/helm/cluster-config/templates/_helpers.tpl 
b/helm/cluster-config/templates/_helpers.tpl
new file mode 100644
index 0000000..0144d79
--- /dev/null
+++ b/helm/cluster-config/templates/_helpers.tpl
@@ -0,0 +1,43 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "chart.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 "chart.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 "chart.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | 
trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "chart.labels" -}}
+helm.sh/chart: {{ include "chart.chart" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
diff --git a/helm/cluster-config/templates/namespaces/infra.yaml 
b/helm/cluster-config/templates/namespaces/infra.yaml
new file mode 100644
index 0000000..fac8d1d
--- /dev/null
+++ b/helm/cluster-config/templates/namespaces/infra.yaml
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: infra
+  labels:
+    {{- include "chart.labels" . | nindent 4 }}
diff --git a/helm/cluster-config/values.yaml b/helm/cluster-config/values.yaml
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/helm/cluster-config/values.yaml
@@ -0,0 +1 @@
+
diff --git a/helm/helmfile.yaml b/helm/helmfile.yaml
new file mode 100644
index 0000000..3234ad5
--- /dev/null
+++ b/helm/helmfile.yaml
@@ -0,0 +1,17 @@
+---
+repositories:
+  - name: jetstack
+    url: https://charts.jetstack.io
+
+releases:
+  - name: cluster-config
+    chart: ./cluster-config
+    namespace: kube-system
+
+  # https://cert-manager.io/docs/installation/helm/
+  - name: cert-manager
+    chart: jetstack/cert-manager
+    namespace: infra
+    version: v1.12.2
+    values:
+      - ./values/cert-manager.yaml
diff --git a/helm/values/cert-manager.yaml b/helm/values/cert-manager.yaml
new file mode 100644
index 0000000..5639d65
--- /dev/null
+++ b/helm/values/cert-manager.yaml
@@ -0,0 +1,3 @@
+installCRDs: true
+nodeSelector:
+  node-type: default
\ No newline at end of file

Reply via email to