Skip to content

Commit

Permalink
helm: improve deployment and service manifest
Browse files Browse the repository at this point in the history
Add support for custom resource definition and extend customisation of
service specific settings.

Signed-off-by: Antoine C <syslog-ng@acolombier.dev>
  • Loading branch information
Antoine Colombier committed Dec 13, 2023
1 parent 50bdf85 commit c631f09
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
4 changes: 4 additions & 0 deletions contrib/syslog-ng-helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
21 changes: 18 additions & 3 deletions contrib/syslog-ng-helm-chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,32 @@ kind: Service
metadata:
name: {{ include "syslog-ng.fullname" . }}
labels:
{{- include "syslog-ng.labels" . | nindent 4 }}
{{- include "syslog-ng.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if eq .Values.service.type "externalip" }}

{{- if eq .Values.service.type "externalip" }}
{{- with .Values.service.externalIPs }}
externalIPs:
{{- toYaml . | nindent 3 }}
{{- end }}
{{- else}}
type: {{ .Values.service.type }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
{{- if .Values.service.loadBalancerClass }}
loadBalancerClass: {{ .Values.service.loadBalancerClass }}
{{- end }}
{{- if .Values.service.sessionAffinity }}
sessionAffinity: {{ .Values.service.sessionAffinity }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
ports:
- name: udp-port
port: 514
Expand Down
9 changes: 8 additions & 1 deletion contrib/syslog-ng-helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,21 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

# syslog-ng have fixed ports tcp 601 and udp 514
# syslog-ng have fixed ports tcp 601 and udp 514
service:
type: ClusterIP
# use externalip for a pre routede exter al ip.
# TO-DO: LoadBalancer
# type: externalip
# externalIPs:
# - 10.205.212.12
annotations: {}
# external-dns.alpha.kubernetes.io/hostname: "syslog.example.com"
loadBalancerSourceRanges: []
# - 10.2.3.0/24
loadBalancerClass: ~
sessionAffinity: ~
externalTrafficPolicy: Cluster


resources: {}
Expand Down
4 changes: 4 additions & 0 deletions news/other-4752.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
helm: improve deployment and service manifest

Add support for custom resource definition and extend customisation of
service specific settings.

0 comments on commit c631f09

Please sign in to comment.