-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IngressNginx as revery proxy ingress solution (#92)
- Loading branch information
Showing
10 changed files
with
108 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
charts/memgraph-high-availability/templates/ingress-nginx-namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ingress-nginx | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": before-hook-creation |
Empty file.
43 changes: 43 additions & 0 deletions
43
charts/memgraph-high-availability/templates/services-coordinators-external.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- $validCoordServices := list "CommonLoadBalancer" "LoadBalancer" "NodePort" "IngressNginx" }} | ||
{{- if not (has .Values.memgraph.externalAccessConfig.coordinator.serviceType $validCoordServices) }} | ||
{{- fail "Invalid environment value for memgraph.externlAccessConfig.coordinator.serviceType. Use 'CommonLoadBalancer', 'LoadBalancer', 'NodePort' or 'IngressNginx'."}} | ||
{{- end }} | ||
|
||
{{ if eq $.Values.memgraph.externalAccessConfig.coordinator.serviceType "IngressNginx"}} | ||
# Placeholder | ||
{{ else if eq $.Values.memgraph.externalAccessConfig.coordinator.serviceType "CommonLoadBalancer"}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: coordinators | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
role: coordinator | ||
ports: | ||
- protocol: TCP | ||
name: bolt | ||
port: {{ $.Values.memgraph.ports.boltPort }} | ||
targetPort: {{ $.Values.memgraph.ports.boltPort }} | ||
{{ else }} | ||
{{- range .Values.coordinators }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: memgraph-coordinator-{{ .id }}-external | ||
spec: | ||
{{ if eq $.Values.memgraph.externalAccessConfig.coordinator.serviceType "LoadBalancer"}} | ||
type: LoadBalancer | ||
{{ else }} | ||
type: NodePort | ||
{{ end }} | ||
selector: | ||
app: memgraph-coordinator-{{ .id }} | ||
ports: | ||
- protocol: TCP | ||
name: bolt | ||
port: {{ $.Values.memgraph.ports.boltPort }} | ||
targetPort: {{ $.Values.memgraph.ports.boltPort }} | ||
{{- end }} | ||
{{ end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
charts/memgraph-high-availability/templates/services-data-external.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- $validDataServices := list "LoadBalancer" "NodePort" "IngressNginx" }} | ||
{{- if not (has .Values.memgraph.externalAccessConfig.dataInstance.serviceType $validDataServices) }} | ||
{{- fail "Invalid environment value for memgraph.externalAccessConfig.dataInstance.serviceType. Use 'LoadBalancer', 'NodePort' or 'IngressNginx'."}} | ||
{{- end }} | ||
|
||
|
||
{{ if eq $.Values.memgraph.externalAccessConfig.dataInstance.serviceType "IngressNginx"}} | ||
# Placeholder | ||
{{ else }} | ||
{{- range .Values.data }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: memgraph-data-{{ .id }}-external | ||
spec: | ||
{{ if eq $.Values.memgraph.externalAccessConfig.dataInstance.serviceType "NodePort"}} | ||
type: NodePort | ||
{{ else }} | ||
type: LoadBalancer | ||
{{ end }} | ||
selector: | ||
app: memgraph-data-{{ .id }} | ||
ports: | ||
- protocol: TCP | ||
name: bolt | ||
port: {{ $.Values.memgraph.ports.boltPort }} | ||
targetPort: {{ $.Values.memgraph.ports.boltPort }} | ||
{{- end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
charts/memgraph-high-availability/templates/tcp-services-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if or (eq $.Values.memgraph.externalAccessConfig.dataInstance.serviceType "IngressNginx") (eq $.Values.memgraph.externalAccessConfig.coordinator.serviceType "IngressNginx") }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: tcp-services | ||
namespace: ingress-nginx | ||
data: | ||
{{- if eq $.Values.memgraph.externalAccessConfig.dataInstance.serviceType "IngressNginx"}} | ||
9000: "default/memgraph-data-0:7687" | ||
9001: "default/memgraph-data-1:7687" | ||
{{- end }} | ||
{{- if eq $.Values.memgraph.externalAccessConfig.coordinator.serviceType "IngressNginx"}} | ||
9011: "default/memgraph-coordinator-1:7687" | ||
9012: "default/memgraph-coordinator-2:7687" | ||
9013: "default/memgraph-coordinator-3:7687" | ||
{{- end }} | ||
{{- end }} |