Prerequisites

Before you can deploy a Neo4j cluster on Kubernetes, you need to:

1. General prerequisites

2. Environment-specific prerequisites

Select the tab as per your Kubernetes environment and complete all prerequisites on it.

  1. Install the gcloud command-line interface (CLI) (https://cloud.google.com/sdk/docs/install).

  2. All the shell commands in this guide assume that the GCP Project, compute zone, and region to use, have been set using the CLOUDSDK_CORE_PROJECT, CLOUDSDK_COMPUTE_ZONE, and CLOUDSDK_COMPUTE_REGION environment variables, for example:

    export CLOUDSDK_CORE_PROJECT="neo4j-helm"
    export CLOUDSDK_COMPUTE_ZONE="europe-west6-c"
    export CLOUDSDK_COMPUTE_REGION="europe-west6"
    export CLOUDSDK_CONTAINER_CLUSTER="my-neo4j-gke-cluster"
  3. If you do not have a Google Kubernetes Engine (GKE) cluster, you can create a multi-node cluster (one node per Neo4j instance) using:

    gcloud container clusters create my-neo4j-gke-cluster --num-nodes=<num>
  4. Configure kubectl to use your GKE cluster using:

    gcloud container clusters get-credentials my-neo4j-gke-cluster
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for my-neo4j-gke-cluster.
  1. Install the aws command-line interface (CLI) (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html). Make sure you complete the AWS configuration step (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html).

  2. Install the eksctl command-line interface (CLI) (https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html).

  3. All the shell commands in this guide assume that the AWS region and availability zone to use, have been set using the AWS_DEFAULT_REGION and AWS_AVAILABILITY_ZONE environment variables, for example:

    export AWS_DEFAULT_REGION="eu-west-1"
    export AWS_AVAILABILITY_ZONE="eu-west-1c"
  4. If you do not have an AWS Elastic Kubernetes Service (EKS) cluster, you can create a multi-node cluster (one node per Neo4j instance) using the following command:

    This command requires that you have a public key named id_rsa.pub. If you do not have one, you can generate it by running:

    ssh-keygen -t rsa -C "your-name@example.com"
    eksctl create cluster -f <(echo "
    apiVersion: eksctl.io/v1alpha5
    kind: ClusterConfig
    metadata:
      name: my-neo4j-eks-cluster
      region: ${AWS_DEFAULT_REGION}
    managedNodeGroups:
      - name: neo4j-nodes
        availabilityZones:
          - "${AWS_AVAILABILITY_ZONE}"
        minSize: 1
        maxSize: 4
        instanceType: c4.xlarge
        desiredCapacity: 4
        volumeSize: 10
        ssh:
          allow: true
    iam:
      withOIDC: true
    ")
  5. Configure kubectl to use your EKS cluster using:

    aws eks update-kubeconfig --name my-neo4j-eks-cluster
  1. Install the az command-line interface (CLI) (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).

  2. Verify that you have a Resource Group with:

    • An Azure Kubernetes Service (AKS) cluster.

    • The AKS cluster principal needs to be assigned roles that allow it to manage Microsoft.Compute/disks in the Resource Group.

  3. Set the Resource group and the location to use as defaults using:

    az configure --defaults group=<MyResourceGroup>
    az configure --defaults location=<MyAzureLocation>

    If you do not have an AKS cluster, follow the steps to create a multi-node cluster (one node per Neo4j instance).

    1. Create a cluster by running:

      az aks create --name my-neo4j-aks-cluster --node-count=<num>
    2. Add the necessary role assignments to the AKS cluster using:

      AKS_PRINCIPAL_ID="$(az aks show --name my-neo4j-aks-cluster \
         --query 'identity.principalId' --output tsv)"
      
      az role assignment create --role "Virtual Machine Contributor" \
                                --assignee-object-id "${AKS_PRINCIPAL_ID}"
    3. Update the AKS cluster’s credentials so that it picks up the new role assignment SP_SECRET="$(az ad sp credential reset --name "${AKS_PRINCIPAL_ID}" --query password -o tsv)"

      az aks update-credentials \
          --name my-neo4j-aks-cluster \
          --reset-service-principal \
          --service-principal "${AKS_PRINCIPAL_ID}" \
          --client-secret "${SP_SECRET}"
  4. Configure kubectl to use your AKS cluster using:

    az aks get-credentials --name my-neo4j-aks-cluster --admin