Skip to content

Commit

Permalink
elastic use library-charts tpl & add useCertManager (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihiverlet authored Jan 22, 2024
1 parent 26628dc commit 96d45a8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 68 deletions.
4 changes: 2 additions & 2 deletions charts/elastic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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: 0.2.1
version: 0.2.2

# 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
Expand All @@ -37,5 +37,5 @@ dependencies:
version: 7.17.3
repository: https://helm.elastic.co
- name: library-chart
version: 1.5.16
version: 1.5.18
repository: https://inseefrlab.github.io/helm-charts-interactive-services
3 changes: 3 additions & 0 deletions charts/elastic/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
tls:
- hosts:
- {{ .Values.ingress.hostname | quote }}
{{- if .Values.ingress.useCertManager }}
secretName: tls-cert-{{ include "library-chart.fullname" . }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.hostname | quote }}
Expand Down
18 changes: 1 addition & 17 deletions charts/elastic/templates/networkpolicy-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{{- if .Values.security.networkPolicy.enabled -}}
{{- if .Values.ingress.enabled -}}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "library-chart.fullname" . }}-2
spec:
podSelector:
matchLabels:
release: {{ .Release.Name | quote }}
ingress:
- from:
{{- toYaml .Values.security.networkPolicy.from | nindent 4 }}
policyTypes:
- Ingress
{{- end }}
{{- end }}
{{ include "library-chart.networkPolicyIngress" . }}
16 changes: 1 addition & 15 deletions charts/elastic/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
{{- if .Values.security.networkPolicy.enabled -}}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "library-chart.fullname" . }}
spec:
podSelector:
matchLabels:
release: {{ .Release.Name | quote }}
ingress:
- from:
- podSelector: {}
policyTypes:
- Ingress
{{- end }}
{{ include "library-chart.networkPolicy" . }}
35 changes: 1 addition & 34 deletions charts/elastic/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
{{- if .Values.route.enabled -}}
{{- $svcPort := .Values.kibana.service.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ .Release.Name }}-kibana
labels:
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
{{- include "library-chart.route.annotations" . | nindent 4 }}
spec:
host: {{ .Values.route.hostname | quote }}
path: /
to:
kind: Service
name: {{ .Release.Name }}-kibana
port:
targetPort: {{ $svcPort }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
key: {{- .Values.route.tls.key }}
{{- end }}
{{- if .Values.route.tls.certificate }}
certificate: {{- .Values.route.tls.certificate }}
{{- end }}
{{- if .Values.route.tls.caCertificate }}
caCertificate: {{- .Values.route.tls.caCertificate }}
{{- end }}
{{- if .Values.route.tls.destinationCACertificate }}
destinationCACertificate: {{- .Values.route.tls.destinationCACertificate }}
{{- end }}
wildcardPolicy: {{ .Values.route.wildcardPolicy }}
{{- end }}
{{ include "library-chart.route" . }}
2 changes: 2 additions & 0 deletions charts/elastic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ingress:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
useCertManager: false
certManagerClusterIssuer: ""

route:
enabled: false
Expand Down

0 comments on commit 96d45a8

Please sign in to comment.