diff --git a/charts/memgraph-high-availability/README.md b/charts/memgraph-high-availability/README.md index 460e72c..632c2d9 100644 --- a/charts/memgraph-high-availability/README.md +++ b/charts/memgraph-high-availability/README.md @@ -43,12 +43,6 @@ The following table lists the configurable parameters of the Memgraph chart and | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `env.MEMGRAPH_ENTERPRISE_LICENSE` | Memgraph enterprise license | `` | | `env.MEMGRAPH_ORGANIZATION_NAME` | Organization name | `` | -| `probes.startup.failureThreshold` | Startup probe failure threshold | `30` | -| `probes.startup.periodSeconds` | Startup probe period in seconds | `10` | -| `probes.readiness.initialDelaySeconds` | Readiness probe initial delay in seconds | `5` | -| `probes.readiness.periodSeconds` | Readiness probe period in seconds | `5` | -| `probes.liveness.initialDelaySeconds` | Liveness probe initial delay in seconds | `30` | -| `probes.liveness.periodSeconds` | Liveness probe period in seconds | `10` | | `storage.libPVCSize` | Size of the storage PVC | `1Gi` | | `storage.libStorageClassName` | The name of the storage class used for storing data. | `` | | `storage.libStorageAccessMode` | Access mode used for lib storage. | `ReadWriteOnce` | diff --git a/charts/memgraph-high-availability/templates/ingress-nginx-namespace.yaml b/charts/memgraph-high-availability/templates/ingress-nginx-namespace.yaml deleted file mode 100644 index 43e4ecf..0000000 --- a/charts/memgraph-high-availability/templates/ingress-nginx-namespace.yaml +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/charts/memgraph-high-availability/templates/ingress-nginx.yaml b/charts/memgraph-high-availability/templates/ingress-nginx.yaml new file mode 100644 index 0000000..64fe032 --- /dev/null +++ b/charts/memgraph-high-availability/templates/ingress-nginx.yaml @@ -0,0 +1,713 @@ +{{- if or (eq $.Values.externalAccessConfig.dataInstance.serviceType "IngressNginx") (eq $.Values.externalAccessConfig.coordinator.serviceType "IngressNginx") }} +apiVersion: v1 +kind: Namespace +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + name: ingress-nginx + annotations: + # Install the namespace before everything else + "helm.sh/hook": pre-install + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": before-hook-creation +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: tcp-services # If you change it, make sure that you change in the ingress-nginx.yaml file too + namespace: ingress-nginx +data: + {{- if eq $.Values.externalAccessConfig.dataInstance.serviceType "IngressNginx"}} + 9000: "default/memgraph-data-0:7687" + 9001: "default/memgraph-data-1:7687" + {{- end }} + {{- if eq $.Values.externalAccessConfig.coordinator.serviceType "IngressNginx"}} + 9011: "default/memgraph-coordinator-1:7687" + 9012: "default/memgraph-coordinator-2:7687" + 9013: "default/memgraph-coordinator-3:7687" + {{- end }} +--- +apiVersion: v1 +automountServiceAccountToken: true +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: v1 +automountServiceAccountToken: true +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx + namespace: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get +- apiGroups: + - "" + resources: + - configmaps + - pods + - secrets + - endpoints + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - update +- apiGroups: + - networking.k8s.io + resources: + - ingressclasses + verbs: + - get + - list + - watch +- apiGroups: + - coordination.k8s.io + resourceNames: + - ingress-nginx-leader + resources: + - leases + verbs: + - get + - update +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - list + - watch + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission + namespace: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx +rules: +- apiGroups: + - "" + resources: + - configmaps + - endpoints + - nodes + - pods + - secrets + - namespaces + verbs: + - list + - watch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - list + - watch +- apiGroups: + - "" + resources: + - nodes + verbs: + - get +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - update +- apiGroups: + - networking.k8s.io + resources: + - ingressclasses + verbs: + - get + - list + - watch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - list + - watch + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission +rules: +- apiGroups: + - admissionregistration.k8s.io + resources: + - validatingwebhookconfigurations + verbs: + - get + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx + namespace: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: ingress-nginx +subjects: +- kind: ServiceAccount + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission + namespace: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: ingress-nginx-admission +subjects: +- kind: ServiceAccount + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ingress-nginx +subjects: +- kind: ServiceAccount + name: ingress-nginx + namespace: ingress-nginx +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ingress-nginx-admission +subjects: +- kind: ServiceAccount + name: ingress-nginx-admission + namespace: ingress-nginx +--- +apiVersion: v1 +data: null +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-controller + namespace: ingress-nginx +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-controller + namespace: ingress-nginx +spec: + externalTrafficPolicy: Local + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + {{- if eq $.Values.externalAccessConfig.dataInstance.serviceType "IngressNginx"}} + - name: data-0 + port: 9000 + targetPort: 9000 + protocol: TCP + - name: data-1 + port: 9001 + targetPort: 9001 + protocol: TCP + {{- end }} + {{- if eq $.Values.externalAccessConfig.coordinator.serviceType "IngressNginx"}} + - 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 + {{- end }} + - appProtocol: http + name: http + port: 80 + protocol: TCP + targetPort: http + - appProtocol: https + name: https + port: 443 + protocol: TCP + targetPort: https + selector: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + type: LoadBalancer +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-controller-admission + namespace: ingress-nginx +spec: + ports: + - appProtocol: https + name: https-webhook + port: 443 + targetPort: webhook + selector: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-controller + namespace: ingress-nginx +spec: + minReadySeconds: 0 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + spec: + containers: + - args: + - /nginx-ingress-controller + - --tcp-services-configmap=ingress-nginx/tcp-services + - --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller + - --election-id=ingress-nginx-leader + - --controller-class=k8s.io/ingress-nginx + - --ingress-class=nginx + - --configmap=$(POD_NAMESPACE)/ingress-nginx-controller + - --validating-webhook=:8443 + - --validating-webhook-certificate=/usr/local/certificates/cert + - --validating-webhook-key=/usr/local/certificates/key + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: LD_PRELOAD + value: /usr/local/lib/libmimalloc.so + image: registry.k8s.io/ingress-nginx/controller:v1.12.0@sha256:e6b8de175acda6ca913891f0f727bca4527e797d52688cbe9fec9040d6f6b6fa + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + livenessProbe: + failureThreshold: 5 + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + name: controller + ports: + - containerPort: 80 + name: http + protocol: TCP + - containerPort: 443 + name: https + protocol: TCP + - containerPort: 8443 + name: webhook + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + requests: + cpu: 100m + memory: 90Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + readOnlyRootFilesystem: false + runAsGroup: 82 + runAsNonRoot: true + runAsUser: 101 + seccompProfile: + type: RuntimeDefault + volumeMounts: + - mountPath: /usr/local/certificates/ + name: webhook-cert + readOnly: true + dnsPolicy: ClusterFirst + nodeSelector: + kubernetes.io/os: linux + serviceAccountName: ingress-nginx + terminationGracePeriodSeconds: 300 + volumes: + - name: webhook-cert + secret: + secretName: ingress-nginx-admission +--- +apiVersion: batch/v1 +kind: Job +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission-create + namespace: ingress-nginx +spec: + template: + metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission-create + spec: + containers: + - args: + - create + - --host=ingress-nginx-controller-admission,ingress-nginx-controller-admission.$(POD_NAMESPACE).svc + - --namespace=$(POD_NAMESPACE) + - --secret-name=ingress-nginx-admission + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.5.0@sha256:aaafd456bda110628b2d4ca6296f38731a3aaf0bf7581efae824a41c770a8fc4 + imagePullPolicy: IfNotPresent + name: create + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65532 + seccompProfile: + type: RuntimeDefault + nodeSelector: + kubernetes.io/os: linux + restartPolicy: OnFailure + serviceAccountName: ingress-nginx-admission +--- +apiVersion: batch/v1 +kind: Job +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission-patch + namespace: ingress-nginx +spec: + template: + metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission-patch + spec: + containers: + - args: + - patch + - --webhook-name=ingress-nginx-admission + - --namespace=$(POD_NAMESPACE) + - --patch-mutating=false + - --secret-name=ingress-nginx-admission + - --patch-failure-policy=Fail + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.5.0@sha256:aaafd456bda110628b2d4ca6296f38731a3aaf0bf7581efae824a41c770a8fc4 + imagePullPolicy: IfNotPresent + name: patch + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65532 + seccompProfile: + type: RuntimeDefault + nodeSelector: + kubernetes.io/os: linux + restartPolicy: OnFailure + serviceAccountName: ingress-nginx-admission +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: nginx +spec: + controller: k8s.io/ingress-nginx +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + labels: + app.kubernetes.io/component: admission-webhook + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx + app.kubernetes.io/version: 1.12.0 + name: ingress-nginx-admission +webhooks: +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: ingress-nginx-controller-admission + namespace: ingress-nginx + path: /networking/v1/ingresses + port: 443 + failurePolicy: Fail + matchPolicy: Equivalent + name: validate.nginx.ingress.kubernetes.io + rules: + - apiGroups: + - networking.k8s.io + apiVersions: + - v1 + operations: + - CREATE + - UPDATE + resources: + - ingresses + sideEffects: None +{{- end }} diff --git a/charts/memgraph-high-availability/templates/tcp-services-configmap.yaml b/charts/memgraph-high-availability/templates/tcp-services-configmap.yaml deleted file mode 100644 index e784930..0000000 --- a/charts/memgraph-high-availability/templates/tcp-services-configmap.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if or (eq $.Values.externalAccessConfig.dataInstance.serviceType "IngressNginx") (eq $.Values.externalAccessConfig.coordinator.serviceType "IngressNginx") }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: tcp-services - namespace: ingress-nginx -data: - {{- if eq $.Values.externalAccessConfig.dataInstance.serviceType "IngressNginx"}} - 9000: "default/memgraph-data-0:7687" - 9001: "default/memgraph-data-1:7687" - {{- end }} - {{- if eq $.Values.externalAccessConfig.coordinator.serviceType "IngressNginx"}} - 9011: "default/memgraph-coordinator-1:7687" - 9012: "default/memgraph-coordinator-2:7687" - 9013: "default/memgraph-coordinator-3:7687" - {{- end }} -{{- end }} diff --git a/charts/memgraph-high-availability/templates/tests/test-cluster-setup.yaml b/charts/memgraph-high-availability/templates/tests/test-cluster-setup.yaml deleted file mode 100644 index f759897..0000000 --- a/charts/memgraph-high-availability/templates/tests/test-cluster-setup.yaml +++ /dev/null @@ -1,79 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-memgraph-test-cluster-setup" - labels: - {{- include "memgraph.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - template: - metadata: - labels: - app: memgraph-ha-test-cluster-setup - spec: - containers: - - name: memgraph-test-cluster-setup - image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}" - command: ["/bin/bash", "-c"] - args: - - | - is_valid_view_of_cluster() { - local instances=$1 # Function accepts one argument = the result of `SHOW INSTANCES` - num_leaders=$(echo "$instances" | grep -c "leader") - if [ $num_leaders -ne 1 ]; then - echo "Expected 1 leader after registration, got $num_leaders." - return 1 - fi - - num_followers=$(echo "$instances" | grep -c "follower") - if [ $num_followers -ne 2 ]; then - echo "Expected 2 followers after registration, got $num_followers." - return 1 - fi - - num_mains=$(echo "$instances" | grep -c "main") - if [ $num_mains -ne 1 ]; then - echo "Expected 1 main after registration, got $num_mains." - return 1 - fi - - num_replicas=$(echo "$instances" | grep -c "replica") - if [ $num_replicas -ne 1 ]; then - echo "Expected 1 replica after registration, got $num_replicas." - return 1 - fi - - num_instances_down=$(echo "instances" | grep -c "down") - if [ $num_instances_down -ne 0 ]; then - echo "Expected 0 instances down after registration, got $num_instances_down." - return 1 - fi - - return 0 - } - # Check if coordinator 1 sees the cluster correctly - coord1_instances=$(echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687) - is_valid_view_of_cluster "$coord1_instances" - if [ $? -ne 0 ]; then - exit 1 - fi - - # Check if coordinator 2 sees the cluster correctly - coord2_instances=$(echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-2.default.svc.cluster.local --port 7687) - is_valid_view_of_cluster "$coord2_instances" - if [ $? -ne 0 ]; then - exit 1 - fi - - # Check if coordinator 3 sees the cluster correctly - coord3_instances=$(echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-3.default.svc.cluster.local --port 7687) - is_valid_view_of_cluster "$coord3_instances" - if [ $? -ne 0 ]; then - exit 1 - fi - - exit 0 - - restartPolicy: Never - backoffLimit: 3 diff --git a/charts/memgraph-high-availability/templates/tests/test-connection.yaml b/charts/memgraph-high-availability/templates/tests/test-connection.yaml deleted file mode 100644 index 8db37fc..0000000 --- a/charts/memgraph-high-availability/templates/tests/test-connection.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Inspect logs of this test with kubectl logs -l app=memgraph-ha-test-connection -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{ .Release.Name }}-memgraph-test-connection" - labels: - {{- include "memgraph.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - template: - metadata: - labels: - app: memgraph-ha-test-connection - spec: - containers: - - name: memgraph-test - image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}" - command: ["/bin/bash", "-c"] - args: - - | - commands=( - "echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687" - "echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-2.default.svc.cluster.local --port 7687" - "echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-3.default.svc.cluster.local --port 7687" - "echo 'RETURN 0;' | mgconsole --host memgraph-data-0.default.svc.cluster.local --port 7687" - "echo 'RETURN 0;' | mgconsole --host memgraph-data-1.default.svc.cluster.local --port 7687" - ) - for command in "${commands[@]}"; do - echo "Running command: $command" - eval $command - if [ $? -ne 0 ]; then - echo "Command failed: $command" - exit 1 - fi - done - exit 0 - - restartPolicy: Never diff --git a/charts/memgraph-high-availability/values.yaml b/charts/memgraph-high-availability/values.yaml index bb254c8..c8dc389 100644 --- a/charts/memgraph-high-availability/values.yaml +++ b/charts/memgraph-high-availability/values.yaml @@ -2,19 +2,10 @@ image: repository: memgraph/memgraph tag: 2.22.0 pullPolicy: IfNotPresent + env: MEMGRAPH_ENTERPRISE_LICENSE: "" MEMGRAPH_ORGANIZATION_NAME: "" -probes: - startup: - failureThreshold: 30 - periodSeconds: 10 - readiness: - initialDelaySeconds: 5 - periodSeconds: 5 - liveness: - initialDelaySeconds: 30 - periodSeconds: 10 storage: libPVCSize: "1Gi" @@ -31,6 +22,7 @@ ports: managementPort: 10000 replicationPort: 20000 coordinatorPort: 12000 + externalAccessConfig: dataInstance: serviceType: "NodePort"