Skip to main content

Install a region

A region is the same Helm chart as a home install, with topology: region. You prepare a cluster in the new location, then install the chart with two files you author: a Secret and my-values.yaml. What a region is and how it relates to home: Regions.

Script-minted Secret and values file: setup.sh --region. Argo CD: GitOps install.

Prerequisites​

  • Home on v1.10.625 or newer, reachable at a public https:// address. No home yet? Install it first.
  • kubectl, Helm 3.10+, and your cloud's CLI (eksctl, gcloud or az).
  • A DNS zone you can add records to, for the region's hostname: <region-hostname> below, such as eu.anyray.example.com. Every employee machine calls it, so it must be public, or reachable over your VPN.
  • Outbound https from the new location to home's address.

Prepare the cluster​

The region runs two gateways, two optimizers and Postgres, and requests 2.6 vCPU and 5.3 GiB. Three 2-vCPU nodes hold it with room for a rolling upgrade; on two, an upgrade waits for room.

1
Create the cluster
EKS
eksctl create cluster --name <cluster-name> --region <aws-region> \
--nodes 3 --node-type m6i.large

GKE and AKS ship a default StorageClass. EKS ships none: install the EBS CSI driver and mark one default (steps).

2
Install ingress-nginx

ingress-nginx is the region's front door. Its Service of type LoadBalancer makes your cloud create the load balancer: a Network Load Balancer on EKS, a TCP load balancer on GKE and AKS.

EKS
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx --create-namespace \
--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-type"=nlb \
--set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-scheme"=internet-facing

Other ways in (Gateway API, AWS ALB, AKS Application Gateway): Exposing a region.

3
Point DNS at the load balancer

Wait for the address, then add the record in your DNS zone:

kubectl get svc -n ingress-nginx ingress-nginx-controller -w
CloudEXTERNAL-IP showsRecord for <region-hostname>
EKSA hostname (…elb.amazonaws.com)CNAME, or a Route 53 alias
GKE, AKSAn IP addressA record

Do this before you install the chart: cert-manager issues the certificate only once the hostname resolves to this load balancer.

4
Get a certificate

cert-manager gets the region's certificate from Let's Encrypt and renews it. Your own certificate, or one on the load balancer instead: Gateway TLS.

helm upgrade --install cert-manager cert-manager \
--repo https://charts.jetstack.io \
--namespace cert-manager --create-namespace --set crds.enabled=true \
--set 'extraArgs={--feature-gates=ACMEHTTP01IngressPathTypeExact=false}'

Without the feature gate, ingress-nginx refuses cert-manager's challenge path and the certificate stays pending. Then create the issuer:

cluster-issuer.yaml
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: <acme-email> # Let's Encrypt expiry notices
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
ingressClassName: nginx
kubectl apply -f cluster-issuer.yaml

Install​

1
Mint the region token on home

Open https://<home-hostname>/regions in home's console (the page has no sidebar entry) and click Add region. Name it with lowercase letters, digits and hyphens, such as eu-west. Copy the arr_… token. The console shows it once.

Add region dialog showing the one-time token

The token appears once. Copy it before you click Done.
2
Choose a namespace
export ANYRAY_NAMESPACE="team-ai" # replace with your target namespace
kubectl create namespace "$ANYRAY_NAMESPACE"
3
Create the anyray-secrets Secret

A region's Secret has three keys. Home's admin key, content key and billing token never go to a region.

anyray-secrets.yaml
apiVersion: v1
kind: Secret
metadata:
name: anyray-secrets
type: Opaque
data:
ANYRAY_REGION_TOKEN: <base64-region-token> # the arr_… token from home
ANYRAY_OPTIMIZER_TOKEN: <base64-optimizer-secret> # openssl rand -hex 32
POSTGRES_PASSWORD: <base64-postgres-password> # openssl rand -hex 16

Encode each value on one line: printf %s "$VALUE" | base64 | tr -d '\n'. Or let External Secrets Operator, Sealed Secrets, SOPS or Vault own the Secret with the same keys.

kubectl apply -n "$ANYRAY_NAMESPACE" -f anyray-secrets.yaml
4
Write your values file
my-values.yaml
topology: region
host: "<region-hostname>"
image:
tag: policy-stable # follows home's build (see Updates)
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod # cert-manager only
tls:
- secretName: anyray-region-tls
hosts:
- "<region-hostname>"
postgres:
storage: 150Gi # IMMUTABLE after install

The chart refuses a region without topology: region, with an image older than v1.10.637, or with postgres.storage under 150Gi (why the floor). Managed Postgres instead: region database.

5
Install the chart
helm repo add anyray https://charts.anyray.ai
helm install anyray anyray/anyray \
--version <x.y.z> -f my-values.yaml --namespace "$ANYRAY_NAMESPACE"

Use chart 0.8.168 or newer (helm search repo anyray/anyray --versions). An older one stops with topology must be single or split.

6
Verify
kubectl rollout status -n "$ANYRAY_NAMESPACE" deployment/anyray-gateway
kubectl get certificate -n "$ANYRAY_NAMESPACE" # READY True
curl -s https://<region-hostname>/region-health
# {"ready":true}

A region that is not ready answers 503 with a reason; the reasons table says what each one needs.

The region is live

On home's Regions page the region reads Connected and its URL column shows https://<region-hostname>.

Regions page with eu-west Connected and ap-south Never connected

eu-west is serving. ap-south was just added and has not reached home yet.

Enrolled machines pick the region up on their own: your people's machines.