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

helm: support for cloud lb #237

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
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 }}
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