Skip to content

Commit

Permalink
chore(witness): remove multiple pool witness service (in favour of de…
Browse files Browse the repository at this point in the history
…ploying multiple full helm charts)
  • Loading branch information
rcmorano committed Jul 15, 2024
1 parent 97d9c92 commit 896743b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 41 deletions.
16 changes: 7 additions & 9 deletions charts/cf-idw/templates/witness-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
{{- $root := .Values -}}
{{ with .Values.witness }}
{{- $witness := . -}}
{{- range $pool := .witPool }}
{{- if $pool.ingress.enabled -}}
{{- if $witness.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "witness-{{ $pool.name }}"
name: witness
labels:
app: "witness-{{ $pool.name }}"
app: witness
labels:
{{- with $pool.ingress.annotations }}
{{- with $witness.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
rules:
{{- range $TLD := $root.ingressTLDs }}
{{- range $host := $pool.ingress.hosts }}
{{- range $host := $witness.ingress.hosts }}
- host: {{ $host }}.{{ $TLD }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "witness-{{ $pool.name }}"
name: "witness"
port:
number: {{ $witness.port | default 5642 }}
{{- end }}
{{- end }}
tls:
- hosts:
{{- range $TLD := $root.ingressTLDs }}
{{- range $host := $pool.ingress.hosts }}
{{- range $host := $witness.ingress.hosts }}
- "{{ $host }}.{{ $TLD }}"
{{- end }}
{{- end }}
{{ end }}
{{ end }}
{{ end }}
12 changes: 5 additions & 7 deletions charts/cf-idw/templates/witness-service.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{{- $root := .Values -}}
{{ with .Values.witness }}
{{- $witness := . -}}
{{- range $pool := .witPool }}
{{- if $pool.enabled -}}
{{- if $witness.enabled -}}
apiVersion: v1
kind: Service
metadata:
labels:
app: witness-{{ $pool.name }}
name: witness-{{ $pool.name }}
app: witness
name: witness
spec:
ports:
{{- range $port := $pool.ports }}
{{- range $port := $witness.ports }}
- name: {{ $port | quote }}
port: {{ $port }}
targetPort: {{ $port }}
{{- end }}
selector:
app: witness-{{ $pool.name }}
{{ end }}
app: witness
{{ end }}
{{ end }}
20 changes: 9 additions & 11 deletions charts/cf-idw/templates/witness-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
{{- $root := .Values -}}
{{ with .Values.witness }}
{{- $witness := . -}}
{{- range $pool := .witPool }}
{{- if $pool.enabled -}}
{{- if $witness.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: witness-{{ $pool.name }}
name: witness-{{ $pool.name }}
app: witness
name: witness
spec:
replicas: 1
selector:
matchLabels:
app: witness-{{ $pool.name }}
app: witness
template:
metadata:
labels:
app: witness-{{ $pool.name }}
app: witness
spec:
restartPolicy: Always
{{- if .tolerations }}
Expand All @@ -34,10 +33,10 @@ spec:
{{- end }}
containers:
- name: witness
image: "{{ $pool.image.repository }}:{{ $pool.image.tag }}"
command: ["kli", "witness", "start", "--alias {{ $pool.name }}"]
image: "{{ .image.repository }}:{{ .image.tag }}"
command: ["kli", "witness", "start", "--alias main"]
ports:
{{- range $port := $pool.ports }}
{{- range $port := .ports }}
- containerPort: {{ $port }}
hostPort: {{ $port }}
protocol: TCP
Expand All @@ -57,8 +56,7 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ $pool.volumeSize | default "1Gi" }}
storage: {{ .volumeSize | default "1Gi" }}

{{ end }}
{{ end }}
{{ end }}
23 changes: 9 additions & 14 deletions charts/cf-idw/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,12 @@ keria:

witness:
enabled: true
witPool:
- name: main
enabled: true
image:
repository: "pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/cf-idw-witness"
tag: "0.1.1-develop-612b15f-9895437336"
ports:
- 5642
- 5643
- 5644
ingress:
enabled: true
hosts:
- witness
image:
repository: "pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/cf-idw-witness"
tag: "0.1.1-develop-612b15f-9895437336"
ports:
- 5642
ingress:
enabled: true
hosts:
- witness

0 comments on commit 896743b

Please sign in to comment.