Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ingress-nginx as revery proxy ingress solution #92

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

as51340
Copy link
Collaborator

@as51340 as51340 commented Dec 4, 2024

  1. Install Memgraph HA
helm install mem-ha-test ./charts/memgraph-high-availability --set memgraph.env.MEMGRAPH_ENTERPRISE_LICENSE=<LICENSE>,memgraph.env.MEMGRAPH_ORGANIZATION_NAME=<ORGANIZATION>,memgraph.affinity.nodeSelection=true,memgraph.externalAccessConfig.dataInstance.serviceType=IngressNginx,memgraph.externalAccessConfig.coordinator.serviceType=IngressNginx
  1. Install ingress-nginx
helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace \
  --set controller.tcp.services.configMapNamespace=ingress-nginx \
  --set controller.tcp.services.configMapName=tcp-services
  1. Open ingress-nginx-controller service for editing
KUBE_EDITOR="nvim" kubectl edit svc ingress-nginx-controller -n ingress-nginx # or any other editor
  1. In spec.ports section, append following configuration for ports:
- name: data-0
  port: 9000
  targetPort: 9000
  protocol: TCP
- name: data-1
  port: 9001
  targetPort: 9001
  protocol: TCP
- name: coord-1
  port: 9011
  targetPort: 9011
  protocol: TCP
- name: coord-2
  port: 9012
  targetPort: 9012
  protocol: TCP
- name: coord-3
  port: 9013
  targetPort: 9013
  protocol: TCP

Save and close the file

  1. Open ingress-nginx-controller deployment for editing
KUBE_EDITOR="nvim" kubectl edit deployment ingress-nginx-controller -n ingress-nginx
  1. Locate args section and append the following option:
- --tcp-services-configmap=ingress-nginx/tcp-services

If you get stuck, more info can be found here https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/.
Save and close the file.

  1. Open Memgraph instance type of connection in Memgraph Lab. For host enter external IP of ingress service. Coordinator 1's port is 9011. Ingress service will be visible
    by runnning:
kubectl get svc -o=wide -A

External IP will be visible there. It's possible that you need to try twice to successfully connect you to coordinator.

  1. Add coordinators and register instances
ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "<ingress-LB-external-ip>:9012", "management_server":  "memgraph-coordinator-2.default.svc.cluster.local:10000", "coordinator_server":  "memgraph-coordinator-2.default.svc.cluster.local:12000"};
ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "<ingress-LB-external-ip>:9013", "management_server":  "memgraph-coordinator-3.default.svc.cluster.local:10000", "coordinator_server":  "memgraph-coordinator-3.default.svc.cluster.local:12000"};
REGISTER INSTANCE instance_0 WITH CONFIG {"bolt_server": "<ingress-LB-external-ip>:9000", "management_server": "memgraph-data-0.default.svc.cluster.local:10000", "replication_server": "memgraph-data-0.default.svc.cluster.local:20000"};
REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "<ingress-LB-external-ip>:9001", "management_server": "memgraph-data-1.default.svc.cluster.local:10000", "replication_server": "memgraph-data-1.default.svc.cluster.local:20000"};
SET INSTANCE instance_1 TO MAIN;
  1. Uninstallation process
helm uninstall ingress-nginx -n ingress-nginx
helm uninstall mem-ha-test
kubectl delete pvc --all

@as51340 as51340 self-assigned this Dec 4, 2024
Copy link
Collaborator

@antejavor antejavor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🚀 🦾

Can you update the config table in README.md with the options for changing the external service type.

@antejavor
Copy link
Collaborator

@as51340 if we are going to release now (no further fixes), make sure to bump up the HA chart version.

@as51340 as51340 merged commit 3c77fe6 into main Dec 4, 2024
1 of 2 checks passed
@as51340 as51340 added the enhancement New feature or request label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants