From 0308253f42c8ce5bd3a6eee52617fec1d7f26b9c Mon Sep 17 00:00:00 2001 From: Mikko Parviainen Date: Thu, 28 Sep 2023 16:36:40 +0300 Subject: [PATCH] [SOL-16523] Migrate fmi-nodeport and fmi-routes to common repo. --- charts/fmi-nodeport/Chart.yaml | 13 +++++++++ charts/fmi-nodeport/templates/nodeport.yaml | 22 ++++++++++++++ charts/fmi-nodeport/values.yaml | 3 ++ charts/fmi-routes/.helmignore | 23 +++++++++++++++ charts/fmi-routes/Chart.yaml | 13 +++++++++ charts/fmi-routes/templates/route.yaml | 32 +++++++++++++++++++++ charts/fmi-routes/values.yaml | 3 ++ 7 files changed, 109 insertions(+) create mode 100644 charts/fmi-nodeport/Chart.yaml create mode 100644 charts/fmi-nodeport/templates/nodeport.yaml create mode 100644 charts/fmi-nodeport/values.yaml create mode 100644 charts/fmi-routes/.helmignore create mode 100644 charts/fmi-routes/Chart.yaml create mode 100644 charts/fmi-routes/templates/route.yaml create mode 100644 charts/fmi-routes/values.yaml diff --git a/charts/fmi-nodeport/Chart.yaml b/charts/fmi-nodeport/Chart.yaml new file mode 100644 index 0000000..eaa327e --- /dev/null +++ b/charts/fmi-nodeport/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: fmi-nodeport +description: Helm chart for defining api nodeport +type: application +version: 0.0.2 +keywords: + - fmi + - nodeport +home: https://github.com/fmidev/fmi-public-helm-charts +maintainers: + - name: Finnish Meteorological Institute + email: admin@weatherproof.fi + url: https://github.com/fmidev diff --git a/charts/fmi-nodeport/templates/nodeport.yaml b/charts/fmi-nodeport/templates/nodeport.yaml new file mode 100644 index 0000000..a32db4d --- /dev/null +++ b/charts/fmi-nodeport/templates/nodeport.yaml @@ -0,0 +1,22 @@ +{{- if .Values.nodeports }} +{{- range $name, $nodeport := .Values.nodeports }} +{{- if $nodeport.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $name }}-nodeport + namespace: {{ $.Release.Namespace }} +spec: + ports: + - name: {{ $name }}-service-port + nodePort: {{ $nodeport.apiPort }} + port: {{ $nodeport.servicePort }} + protocol: TCP + targetPort: {{ $nodeport.targetPodPort }} + selector: + app.kubernetes.io/instance: {{ $.Release.Namespace }} + type: NodePort +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fmi-nodeport/values.yaml b/charts/fmi-nodeport/values.yaml new file mode 100644 index 0000000..d06571f --- /dev/null +++ b/charts/fmi-nodeport/values.yaml @@ -0,0 +1,3 @@ +# Intentionally empty default configuration +fmi-nodeports: + nodeports: diff --git a/charts/fmi-routes/.helmignore b/charts/fmi-routes/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/fmi-routes/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/fmi-routes/Chart.yaml b/charts/fmi-routes/Chart.yaml new file mode 100644 index 0000000..f308b10 --- /dev/null +++ b/charts/fmi-routes/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: fmi-routes +description: Helm chart for defining multiple routes +type: application +version: 0.0.8 +keywords: + - fmi + - route +home: https://github.com/fmidev/fmi-public-helm-charts +maintainers: + - name: Finnish Meteorological Institute + email: admin@weatherproof.fi + url: https://github.com/fmidev diff --git a/charts/fmi-routes/templates/route.yaml b/charts/fmi-routes/templates/route.yaml new file mode 100644 index 0000000..33e1cbb --- /dev/null +++ b/charts/fmi-routes/templates/route.yaml @@ -0,0 +1,32 @@ +{{- if .Values.routes }} +{{- range $name, $route := .Values.routes }} +{{- if $route.enabled }} +--- +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: {{ $name }} + namespace: {{ $.Release.Namespace }} + labels: + type: {{ $route.type }} + {{- if $route.annotations }} + annotations: +{{ toYaml $route.annotations | indent 4 }} + {{- end }} +spec: + host: {{ $route.host }} + port: + targetPort: {{ $route.targetPort }} + to: + kind: Service + name: {{ $route.targetService }} + weight: 100 + wildcardPolicy: None + {{- if $route.tls }} + tls: + termination: {{ $route.tls.termination }} + insecureEdgeTerminationPolicy: {{ $route.tls.insecureEdgeTerminationPolicy }} + {{- end }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/fmi-routes/values.yaml b/charts/fmi-routes/values.yaml new file mode 100644 index 0000000..c6ad504 --- /dev/null +++ b/charts/fmi-routes/values.yaml @@ -0,0 +1,3 @@ +# Intentionally empty default configuration +fmi-routes: + routes: