Skip to content

Commit

Permalink
Update opensearch version and fix names from subcharts (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaspi authored Sep 26, 2024
1 parent 8b356d1 commit 838eab5
Show file tree
Hide file tree
Showing 17 changed files with 144 additions and 158 deletions.
8 changes: 4 additions & 4 deletions charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.

appVersion: "2.17.0"
dependencies:
- name: opensearch-dashboards
version: 2.19.0
version: 2.23.0
repository: https://opensearch-project.github.io/helm-charts/
- name: opensearch
version: 2.21.0
version: 2.25.0
repository: https://opensearch-project.github.io/helm-charts/

4 changes: 2 additions & 2 deletions charts/opensearch/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $pvcList := list }}
{{- $replicas := int .Values.opensearch.replicas }}
{{- range $e, $i := until $replicas }}
{{- $pvcList = append $pvcList (printf "%s-%s-%d" "opensearch-cluster-master" "opensearch-cluster-master" $i) }}
{{- range $i := until $replicas }}
{{- $pvcList = append $pvcList (printf "%s-%s-%d" (include "opensearch.uname" $.Subcharts.opensearch) (include "opensearch.uname" $.Subcharts.opensearch) $i) }}
{{- end }}
- Your username is **admin**
- Your password is **{{ include "opensearch.StrongPassword" . }}**
Expand Down
16 changes: 0 additions & 16 deletions charts/opensearch/templates/_common.tpl

This file was deleted.

23 changes: 0 additions & 23 deletions charts/opensearch/templates/_ingress.tpl
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Returns true if the ingressClassname field is supported
Usage:
{{ include "common.ingress.supportsIngressClassname" . }}
*/}}
{{- define "opensearch.ingress.supportsIngressClassname" -}}
{{- if semverCompare "<1.18-0" (include "opensearch.capabilities.kubeVersion" .) -}}
{{- print "false" -}}
{{- else -}}
{{- print "true" -}}
{{- end -}}
{{- end -}}

{{/* Ingress annotations */}}
{{- define "opensearch.ingress.annotations" -}}
{{- with .Values.ingress.annotations }}
Expand Down Expand Up @@ -40,13 +27,3 @@ cert-manager.io/cluster-issuer: {{ .Values.ingressDashboard.certManagerClusterIs
acme.cert-manager.io/http01-ingress-class: {{ .Values.ingressDashboard.ingressClassName }}
{{- end }}
{{- end }}

{{/* Ingress hostname */}}
{{- define "opensearch.ingress.hostname" -}}
{{- if .Values.ingress.generate }}
{{- printf "%s" .Values.ingress.userHostname }}
{{- else }}
{{- printf "%s" .Values.ingress.hostname }}
{{- end }}
{{- end }}

21 changes: 0 additions & 21 deletions charts/opensearch/templates/_label.tpl

This file was deleted.

33 changes: 0 additions & 33 deletions charts/opensearch/templates/_name.tpl

This file was deleted.

18 changes: 0 additions & 18 deletions charts/opensearch/templates/_route.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,3 @@ haproxy.router.openshift.io/ip_whitelist: {{ .Values.security.allowlist.ip }}
haproxy.router.openshift.io/ip_whitelist: {{ .Values.security.allowlist.ip }}
{{- end }}
{{- end }}

{{/* Route hostname */}}
{{- define "opensearch.route.hostname" -}}
{{- if .Values.route.generate }}
{{- printf "%s" .Values.route.userHostname }}
{{- else }}
{{- printf "%s" .Values.route.hostname }}
{{- end }}
{{- end }}

{{/* Route Dashboard hostname */}}
{{- define "opensearch.routeDasboard.hostname" -}}
{{- if .Values.routeDashboard.generate }}
{{- printf "%s" .Values.routeDashboard.userHostname }}
{{- else }}
{{- printf "%s" .Values.routeDashboard.hostname }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/opensearch/templates/discovery-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.opensearch.discoverable.allow }}
{{- $fullName := include "opensearch.fullname" . -}}
{{- $fullName := include "opensearch.fullname" .Subcharts.opensearch -}}
{{- $serviceName:= printf "%s-%s" .Release.Name "opensearch" }}
{{- $secretName := printf "%s-%s" "discoverable" $fullName -}}
apiVersion: v1
Expand Down
13 changes: 6 additions & 7 deletions charts/opensearch/templates/ingress-dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{{- if .Values.ingressDashboard.enabled -}}
{{- $fullName := include "opensearch.fullname" . -}}
{{- $svcPort := .Values.networking.dashboard.port -}}
{{- $fullName := include "opensearch-dashboards.fullname" (index .Subcharts "opensearch-dashboards") -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-dashboards
labels:
{{- include "opensearch.labels" . | nindent 4 }}
{{- include "opensearch-dashboards.labels" (index .Subcharts "opensearch-dashboards") | nindent 4 }}
annotations:
{{- include "opensearch.ingressDashboard.annotations" . | nindent 4 }}
spec:
{{- if and .Values.ingressDashboard.ingressClassName (eq "true" (include "opensearch.ingress.supportsIngressClassname" .)) }}
{{- if and .Values.ingressDashboard.ingressClassName (eq "true" (include "opensearch-dashboards.ingress.supportsIngressClassName" (index .Subcharts "opensearch-dashboards"))) }}
ingressClassName: {{ .Values.ingressDashboard.ingressClassName | quote }}
{{- end }}
{{- if .Values.ingressDashboard.tls }}
tls:
- hosts:
- {{ .Values.ingressDashboard.hostname | quote }}
{{- if .Values.ingressDashboard.useCertManager }}
secretName: tls-cert-{{ include "opensearch.fullname" . }}-dashboard
secretName: tls-cert-{{ $fullName }}
{{- end }}
{{- end }}
rules:
Expand All @@ -29,7 +28,7 @@ spec:
pathType: Prefix
backend:
service:
name: {{ $fullName }}-opensearch-dashboards
name: {{ $fullName }}
port:
number: {{ $svcPort }}
number: {{ (index .Values "opensearch-dashboards").service.port }}
{{- end }}
13 changes: 6 additions & 7 deletions charts/opensearch/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "opensearch.fullname" . -}}
{{- $svcPort := .Values.networking.service.port -}}
{{- $fullName := include "opensearch.fullname" .Subcharts.opensearch -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-ui
labels:
{{- include "opensearch.labels" . | nindent 4 }}
{{- include "opensearch.labels" .Subcharts.opensearch | nindent 4 }}
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
{{- include "opensearch.ingress.annotations" . | nindent 4 }}
spec:
{{- if and .Values.ingress.ingressClassName (eq "true" (include "opensearch.ingress.supportsIngressClassname" .)) }}
{{- if and .Values.ingress.ingressClassName (eq "true" (include "opensearch.ingress.supportsIngressClassName" .Subcharts.opensearch)) }}
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
- hosts:
- {{ .Values.ingress.hostname | quote }}
{{- if .Values.ingress.useCertManager }}
secretName: tls-cert-{{ include "opensearch.fullname" . }}
secretName: tls-cert-{{ $fullName }}
{{- end }}
{{- end }}
rules:
Expand All @@ -30,7 +29,7 @@ spec:
pathType: Prefix
backend:
service:
name: opensearch-cluster-master
name: {{ include "opensearch.serviceName" .Subcharts.opensearch }}
port:
number: {{ $svcPort }}
number: {{ .Values.opensearch.httpPort }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/opensearch/templates/networkpolicy-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "opensearch.fullname" . }}-2
name: {{ include "opensearch.fullname" .Subcharts.opensearch }}-2
spec:
podSelector:
matchLabels:
{{- include "opensearch.selectorLabels" . | nindent 6 }}
{{- include "opensearch.selectorLabels" .Subcharts.opensearch | nindent 6 }}
ingress:
{{- with .Values.security.networkPolicy.from }}
- from:
- from:
{{- toYaml . | nindent 4 }}
{{- end }}
policyTypes:
- Ingress
{{- end }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/opensearch/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "opensearch.fullname" . }}
name: {{ include "opensearch.fullname" .Subcharts.opensearch }}
spec:
podSelector:
matchLabels:
{{- include "opensearch.selectorLabels" . | nindent 6 }}
{{- include "opensearch.selectorLabels" .Subcharts.opensearch | nindent 6 }}
ingress:
- from:
- podSelector: {}
policyTypes:
- Ingress
{{- end }}
{{- end }}
9 changes: 4 additions & 5 deletions charts/opensearch/templates/route-dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.route.enabled -}}
{{- $fullName := include "opensearch.fullname" . -}}
{{- $svcPort := .Values.networking.dashboard.port -}}
{{- $fullName := include "opensearch-dashboards.fullname" (index .Subcharts "opensearch-dashboards") -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ $fullName }}-dashboards
name: {{ $fullName }}
labels:
{{- include "opensearch.labels" . | nindent 4 }}
{{- include "opensearch.labels" .Subcharts.opensearch | nindent 4 }}
annotations:
{{- include "opensearch.routeDashboard.annotations" . | nindent 4 }}
spec:
Expand All @@ -16,7 +15,7 @@ spec:
kind: Service
name: opensearch-cluster-master
port:
targetPort: {{ $svcPort }}
targetPort: {{ (index .Values "opensearch-dashboards").service.port }}
tls:
termination: {{ .Values.routeDashboard.tls.termination }}
{{- if .Values.routeDashboard.tls.key }}
Expand Down
3 changes: 1 addition & 2 deletions charts/opensearch/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if .Values.route.enabled -}}
{{- $fullName := include "opensearch.fullname" . -}}
{{- $svcPort := .Values.networking.service.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
Expand All @@ -16,7 +15,7 @@ spec:
kind: Service
name: opensearch-cluster-master
port:
targetPort: {{ $svcPort }}
targetPort: {{ .Values.opensearch.httpPort }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
Expand Down
Loading

0 comments on commit 838eab5

Please sign in to comment.