You are currently viewing the new Anvil Editor Docs.
Switch to the Classic Editor Docs
You are currently viewing the Classic Editor Docs.
Switch to the new Anvil Editor Docs

Installation in Kubernetes

This guide assumes you are comfortable working at a terminal. You should have the necessary Anvil Enterprise Prerequisites and Kubernetes Prerequisites ready.

Make sure your cluster is fully set up before attempting the steps in this section. You can follow one of our guides for the major cloud providers, or our K3s guide if installing directly on a virtual machine. To check that you’re ready, run kubectl get nodes and check that it returns without any errors.

Once you have a Kubernetes cluster available, you can go ahead with the installation of Anvil Enterprise.

Prepare the cluster

If you will be installing Anvil in a namespace other than default, create that first:

kubectl create namespace anvil

The following commands assume that you are installing into the anvil namespace - remove or modify the “-n anvil” flag below if not.

Next install secrets containing your Anvil licence key and your Anvil Registry credentials:

kubectl create -n anvil secret docker-registry anvil-registry-creds \
    --docker-server=anvil.works:4455 \
    --docker-username='USERNAME' --docker-password='PASSWORD'

kubectl create -n anvil secret generic anvil-licence-key \
    --from-literal=value='LICENCE_KEY'

If you have generated TLS certificates for your Anvil installation, create Secrets to store those now. Replace ./privkey.pem and ./fullchain.pem in the command below:

kubectl create -n anvil secret generic anvil-certs \
    --from-file=tls.key=./privkey.pem --from-file=tls.crt=./fullchain.pem

Install the Anvil Operator

Now install the Anvil Operator, which will manage your Anvil Cluster for you:

helm repo add anvil https://charts.anvil.works
helm install anvil-crds anvil/anvil-crds
helm install anvil-operator anvil/anvil-operator

Install Anvil Enterprise

With the operator installed, you are ready to proceed with your Anvil Enterprise installation. Your Anvil cluster is described by a single Kubernetes Custom Resource in a YAML file. This will be pre-configured and provided to you by a member of the Anvil team during the installation. Install it with the following command:

kubectl apply -f anvil-cluster.yml

The Anvil Operator will notice the new Anvil Cluster resource and create all the necessary Kubernetes Resources for your cluster. Once your DNS records are installed, you can visit your local Anvil Enterprise installation by typing your chosen primary domain name into your browser.


Do you still have questions?

Our Community Forum is full of helpful information and Anvil experts.