Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
helm: support for cloud lb (#237)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ángel Ortuño <[email protected]>
  • Loading branch information
ortuman authored Jun 1, 2022
1 parent 972c707 commit e86a615
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 39 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,56 +1,24 @@
{{- $replicasCount := int .Values.jackal.replicasCount -}}
{{- $baseNodePort := 30000 -}}
{{- range $i := until $replicasCount }}
---
apiVersion: v1
kind: Service
metadata:
name: jackal-{{ $i }}
namespace: {{ $.Release.Namespace }}
labels:
app: jackal-{{ $i }}
spec:
type: NodePort
selector:
app: jackal-{{ $i }}
ports:
{{- range $j, $ln := $.Values.jackal.config.c2s.listeners }}
- port: {{ $ln.port }}
name: c2s-{{ $j }}
targetPort: {{ $ln.port }}
nodePort: {{ $baseNodePort }}
{{- $baseNodePort = add1 $baseNodePort -}}
{{- end }}
{{- range $j, $ln := $.Values.jackal.config.s2s.listeners }}
- port: {{ $ln.port }}
name: s2s-{{ $j }}
targetPort: {{ $ln.port }}
nodePort: {{ $baseNodePort }}
{{- $baseNodePort = add1 $baseNodePort -}}
{{- end }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jackal-{{ $i }}
name: jackal
namespace: {{ $.Release.Namespace }}
labels:
app: jackal-{{ $i }}
app: jackal
heritage: {{ $.Release.Service }}
release: {{ $.Release.Name }}
spec:
replicas: 1
replicas: {{ .Values.jackal.replicasCount }}
selector:
matchLabels:
app: jackal-{{ $i }}
app: jackal
strategy: {}
template:
metadata:
annotations:
rollme: {{ randAlphaNum 5 | quote }}
labels:
app: jackal-{{ $i }}
component: jackal
app: jackal
spec:
nodeSelector:
{{- toYaml $.Values.jackal.nodeSelector | nindent 8 }}
Expand Down Expand Up @@ -81,7 +49,7 @@ spec:
- "-lapp=redis"

containers:
- name: jackal-{{ $i }}
- name: jackal
args:
- ./jackal
- -config=/etc/jackal/config.yaml
Expand Down Expand Up @@ -143,4 +111,3 @@ spec:
- name: config-volume
configMap:
name: jackal-config
{{- end }}
File renamed without changes.
24 changes: 24 additions & 0 deletions helm/templates/svc-jackal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: jackal
namespace: {{ $.Release.Namespace }}
annotations:
{{- toYaml $.Values.jackal.loadBalancer.extraAnnotations | nindent 4 }}
labels:
app: jackal
spec:
type: LoadBalancer
selector:
app: jackal
ports:
{{- range $j, $ln := $.Values.jackal.config.c2s.listeners }}
- port: {{ $ln.port }}
name: c2s-{{ $j }}
targetPort: {{ $ln.port }}
{{- end }}
{{- range $j, $ln := $.Values.jackal.config.s2s.listeners }}
- port: {{ $ln.port }}
name: s2s-{{ $j }}
targetPort: {{ $ln.port }}
{{- end }}
File renamed without changes.
3 changes: 3 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jackal:
cpu: 120m
memory: 64Mi

loadBalancer:
extraAnnotations: {}

config:
logger:
level: debug
Expand Down

0 comments on commit e86a615

Please sign in to comment.