diff --git a/templates/_helpers.yaml b/templates/_helpers.yaml index 38d4c09..beb3dca 100644 --- a/templates/_helpers.yaml +++ b/templates/_helpers.yaml @@ -1,4 +1,3 @@ - {{- define "graphdb.resolveDeploymentHost" -}} {{- $global := .Values.global | default dict -}} {{- $globalDeployment := $global.deployment | default dict -}} diff --git a/templates/configuration/graphdb-logback-configmap.yaml b/templates/graphdb/configmap-logback.yaml similarity index 100% rename from templates/configuration/graphdb-logback-configmap.yaml rename to templates/graphdb/configmap-logback.yaml diff --git a/templates/configuration/graphdb-properties-configmap.yaml b/templates/graphdb/configmap-properties.yaml similarity index 100% rename from templates/configuration/graphdb-properties-configmap.yaml rename to templates/graphdb/configmap-properties.yaml diff --git a/templates/configuration/graphdb-settings-configmap.yaml b/templates/graphdb/configmap-settings.yaml similarity index 100% rename from templates/configuration/graphdb-settings-configmap.yaml rename to templates/graphdb/configmap-settings.yaml diff --git a/templates/configuration/graphdb-users-configmap.yaml b/templates/graphdb/configmap-users.yaml similarity index 100% rename from templates/configuration/graphdb-users-configmap.yaml rename to templates/graphdb/configmap-users.yaml diff --git a/templates/configuration/graphdb-node-configmap.yaml b/templates/graphdb/configmap.yaml similarity index 100% rename from templates/configuration/graphdb-node-configmap.yaml rename to templates/graphdb/configmap.yaml diff --git a/templates/graphdb/pdb.yaml b/templates/graphdb/pdb.yaml new file mode 100644 index 0000000..94b16d5 --- /dev/null +++ b/templates/graphdb/pdb.yaml @@ -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 }} diff --git a/templates/graphdb/service.yaml b/templates/graphdb/service.yaml new file mode 100644 index 0000000..02bd79c --- /dev/null +++ b/templates/graphdb/service.yaml @@ -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 }} diff --git a/templates/graphdb-node.yaml b/templates/graphdb/statefulset.yaml similarity index 89% rename from templates/graphdb-node.yaml rename to templates/graphdb/statefulset.yaml index d8fe5d4..92d379c 100644 --- a/templates/graphdb-node.yaml +++ b/templates/graphdb/statefulset.yaml @@ -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 }} @@ -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 }} diff --git a/templates/gateway/ingress.yaml b/templates/ingress.yaml similarity index 100% rename from templates/gateway/ingress.yaml rename to templates/ingress.yaml diff --git a/templates/configuration/graphdb-cluster-config-configmap.yaml b/templates/jobs/configmap-cluster-config.yaml similarity index 100% rename from templates/configuration/graphdb-cluster-config-configmap.yaml rename to templates/jobs/configmap-cluster-config.yaml diff --git a/templates/graphdb-utils-configmap.yaml b/templates/jobs/configmap-utils.yaml similarity index 100% rename from templates/graphdb-utils-configmap.yaml rename to templates/jobs/configmap-utils.yaml diff --git a/templates/jobs/post-start-job.yaml b/templates/jobs/job-create-cluster.yaml similarity index 100% rename from templates/jobs/post-start-job.yaml rename to templates/jobs/job-create-cluster.yaml diff --git a/templates/jobs/patch-cluster-job.yaml b/templates/jobs/job-patch-cluster.yaml similarity index 100% rename from templates/jobs/patch-cluster-job.yaml rename to templates/jobs/job-patch-cluster.yaml diff --git a/templates/jobs/provision-repositories-job.yaml b/templates/jobs/job-provision-repositories.yaml similarity index 100% rename from templates/jobs/provision-repositories-job.yaml rename to templates/jobs/job-provision-repositories.yaml diff --git a/templates/jobs/scale-down-cluster-job.yaml b/templates/jobs/job-scale-down-cluster.yaml similarity index 100% rename from templates/jobs/scale-down-cluster-job.yaml rename to templates/jobs/job-scale-down-cluster.yaml diff --git a/templates/jobs/scale-up-cluster-job.yaml b/templates/jobs/job-scale-up-cluster.yaml similarity index 100% rename from templates/jobs/scale-up-cluster-job.yaml rename to templates/jobs/job-scale-up-cluster.yaml diff --git a/templates/graphdb-provision-user-secret.yaml b/templates/jobs/secret-provision-user.yaml similarity index 100% rename from templates/graphdb-provision-user-secret.yaml rename to templates/jobs/secret-provision-user.yaml diff --git a/templates/configuration/graphdb-proxy-properties-configmap.yaml b/templates/proxy/configmap-properties.yaml similarity index 100% rename from templates/configuration/graphdb-proxy-properties-configmap.yaml rename to templates/proxy/configmap-properties.yaml diff --git a/templates/configuration/graphdb-cluster-proxy-configmap.yaml b/templates/proxy/configmap.yaml similarity index 100% rename from templates/configuration/graphdb-cluster-proxy-configmap.yaml rename to templates/proxy/configmap.yaml diff --git a/templates/proxy/service-headless.yaml b/templates/proxy/service-headless.yaml new file mode 100644 index 0000000..4af1344 --- /dev/null +++ b/templates/proxy/service-headless.yaml @@ -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 }} diff --git a/templates/proxy/service.yaml b/templates/proxy/service.yaml new file mode 100644 index 0000000..3a938bb --- /dev/null +++ b/templates/proxy/service.yaml @@ -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 }} diff --git a/templates/graphdb-cluster-proxy.yaml b/templates/proxy/statefulset.yaml similarity index 82% rename from templates/graphdb-cluster-proxy.yaml rename to templates/proxy/statefulset.yaml index da443c5..32df498 100644 --- a/templates/graphdb-cluster-proxy.yaml +++ b/templates/proxy/statefulset.yaml @@ -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 }} @@ -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 }}