Skip to content

Commit

Permalink
GDB-9446: Split resources
Browse files Browse the repository at this point in the history
- Organized the resources in separate YAML files
- Organized the files in separate directories
  • Loading branch information
mihailradkov committed Mar 29, 2024
1 parent 6667f28 commit 88dbb99
Show file tree
Hide file tree
Showing 23 changed files with 90 additions and 92 deletions.
1 change: 0 additions & 1 deletion templates/_helpers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{{- define "graphdb.resolveDeploymentHost" -}}
{{- $global := .Values.global | default dict -}}
{{- $globalDeployment := $global.deployment | default dict -}}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions templates/graphdb/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.graphdb.pdb.create }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: graphdb-node
labels:
{{- include "graphdb.labels" . | nindent 4 }}
spec:
{{- if .Values.graphdb.pdb.minAvailable }}
minAvailable: {{ .Values.graphdb.pdb.minAvailable }}
{{- end }}
{{- if .Values.graphdb.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.graphdb.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: graphdb-node
{{- end }}
26 changes: 26 additions & 0 deletions templates/graphdb/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: graphdb-node
labels:
app: graphdb-node
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.node.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
app: graphdb-node
ports:
- name: graphdb
port: 7200
targetPort: 7200
protocol: TCP
{{- if gt (int $.Values.graphdb.clusterConfig.nodesCount) 1 }}
- name: rpc
port: 7300
targetPort: 7300
protocol: TCP
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/configuration/graphdb-node-configmap.yaml") . | sha256sum }}
checksum/configmap: {{ include (print $.Template.BasePath "/graphdb/configmap.yaml") . | sha256sum }}
{{- with .Values.graphdb.node.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -212,50 +212,3 @@ spec:
{{- with .Values.graphdb.node.extraInitContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: graphdb-node
labels:
app: graphdb-node
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.node.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
app: graphdb-node
ports:
- name: graphdb
port: 7200
targetPort: 7200
protocol: TCP
{{- if gt (int $.Values.graphdb.clusterConfig.nodesCount) 1 }}
- name: rpc
port: 7300
targetPort: 7300
protocol: TCP
{{- end }}

{{- if .Values.graphdb.pdb.create }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: graphdb-node
labels:
{{- include "graphdb.labels" . | nindent 4 }}
spec:
{{- if .Values.graphdb.pdb.minAvailable }}
minAvailable: {{ .Values.graphdb.pdb.minAvailable }}
{{- end }}
{{- if .Values.graphdb.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.graphdb.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: graphdb-node
{{- end }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions templates/proxy/service-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if gt (int $.Values.graphdb.clusterConfig.nodesCount) 1 }}
apiVersion: v1
kind: Service
metadata:
name: graphdb-proxy
labels:
app: graphdb-cluster-proxy
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.clusterProxy.headlessService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
app: graphdb-cluster-proxy
ports:
- name: gdb-proxy-rpc
port: 7300
targetPort: 7300
protocol: TCP
{{- end }}
22 changes: 22 additions & 0 deletions templates/proxy/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if gt (int $.Values.graphdb.clusterConfig.nodesCount) 1 }}
apiVersion: v1
kind: Service
metadata:
name: graphdb-cluster-proxy
labels:
app: graphdb-cluster-proxy
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.clusterProxy.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ $.Values.graphdb.clusterProxy.serviceType }}
selector:
app: graphdb-cluster-proxy
ports:
- name: gdb-proxy-port
port: 7200
targetPort: 7200
protocol: TCP
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/configuration/graphdb-cluster-proxy-configmap.yaml") . | sha256sum }}
checksum/configmap: {{ include (print $.Template.BasePath "/proxy/configmap.yaml") . | sha256sum }}
{{- with .Values.graphdb.clusterProxy.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -111,46 +111,4 @@ spec:
{{- with .Values.graphdb.clusterProxy.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: graphdb-cluster-proxy
labels:
app: graphdb-cluster-proxy
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.clusterProxy.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ $.Values.graphdb.clusterProxy.serviceType }}
selector:
app: graphdb-cluster-proxy
ports:
- name: gdb-proxy-port
port: 7200
targetPort: 7200
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: graphdb-proxy
labels:
app: graphdb-cluster-proxy
{{- include "graphdb.labels" . | nindent 4 }}
{{- with .Values.graphdb.clusterProxy.headlessService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
app: graphdb-cluster-proxy
ports:
- name: gdb-proxy-rpc
port: 7300
targetPort: 7300
protocol: TCP
{{- end }}

0 comments on commit 88dbb99

Please sign in to comment.