AWS Deployment

Deploy your self-hosted Dgraph cluster on Amazon Web Services using Elastic Kubernetes Service (EKS).

1. Infrastructure Setup

EKS Cluster Creation

aws eks create-cluster \
  --name dgraph-cluster \
  --version 1.28 \
  --role-arn arn:aws:iam::ACCOUNT:role/eks-service-role \
  --resources-vpc-config subnetIds=subnet-12345,securityGroupIds=sg-12345

Storage Class Configuration

aws-storage-class.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: dgraph-storage
provisioner: ebs.csi.aws.com
parameters:
  type: gp3
  iops: "3000"
  throughput: "125"
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true

2. Dgraph Deployment on AWS

1

Apply Storage Class

bash kubectl apply -f aws-storage-class.yaml
2

Add Helm Repository

bash helm repo add dgraph https://charts.dgraph.io helm repo update
3

Create Namespace

bash kubectl create namespace dgraph
4

Deploy Dgraph

helm install dgraph dgraph/dgraph \
  --namespace dgraph \
  --set image.tag="v23.1.0" \
  --set alpha.persistence.storageClass="dgraph-storage" \
  --set alpha.persistence.size="500Gi" \
  --set zero.persistence.storageClass="dgraph-storage" \
  --set zero.persistence.size="100Gi" \
  --set alpha.replicaCount=3 \
  --set zero.replicaCount=3 \
  --set alpha.resources.requests.memory="8Gi" \
  --set alpha.resources.requests.cpu="2000m"

3. Load Balancer Configuration

aws-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dgraph-ingress
  namespace: dgraph
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:REGION:ACCOUNT:certificate/CERT-ID
spec:
  rules:
    - host: dgraph.yourdomain.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: dgraph-dgraph-alpha
                port:
                  number: 8080