Skip to content

couchbase-partners/azure-aks-couchbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

azure-kubernetes-couchbase

This is a walkthrough of setting the Couchbase Operator up on Azure Container Service (AKS).

Deploy an AKS Cluster

AKS is currently in public preview. There are a bunch of nice tutorials on how to use it.

For this walkthrough we're going to use the Azure 2.0 CLI. If you haven't already, you'll need to install that and login. Even if you have the CLI installed already, you might want to update it. An alternative would be to do all this in a cloud shell, though you'll eventually need to get kubectl working locally in order to set up a tunnel to open a web browser to your Couchbase cluster.

To make sure the Azure 2.0 CLI is working properly try running:

az group list

With that all set, we can register the AKS provider. Presumably once the service goes GA this won't be necessary.

az provider register -n Microsoft.ContainerService

If that runs well, you should see:

provider

Now you're ready to create a resource group and a cluster inside that:

az group create --name myResourceGroup --location eastus
az aks create --resource-group myResourceGroup --name myAKSCluster

Note that it's way easier to do this from the CLI because the CLI creates the service principal you need automatically. If you do this in the portal you'll need to create the service principal manually.

deploying

When that's done, or even while it's running, you can login to the Azure Portal and take a look at your new cluster there as well:

portal

Configure kubectl

Now that we have a cluster, the next step is to install and set up kubectl up so it can connect to the cluster.

az aks install-cli
az aks get-credentials --resource-group=myResourceGroup --name=myAKSCluster

You should see something like this:

getcreds

You might need to set your KUBECONFIG too:

export KUBECONFIG=~/.kube/config

With all that set up we can make sure our kubectl is working by running:

kubectl get nodes

That should show three nodes:

getnodes

Deploying the Operator

Once you have an AKS cluster deployed and a running kubectl, you're ready to deploy the Operator. The documentation on that is here.

To create the deployment and check it deployed, run this:

kubectl create -f https://s3.amazonaws.com/packages.couchbase.com/kubernetes/beta/operator.yaml
kubectl get deployments

You should see something like this:

operatordeployed

Deploying a Couchbase Cluster

We're there! Time to get a live cluster. Run this:

kubectl create -f https://s3.amazonaws.com/packages.couchbase.com/kubernetes/beta/secret.yaml
kubectl create -f https://s3.amazonaws.com/packages.couchbase.com/kubernetes/beta/couchbase-cluster.yaml

That should give this:

couchbasecreated

You can view the Couchbase and operator pods by running:

kubectl get pods

Accessing the Couchbase Web UI

You've now got a cluster. But to use it you probably want to set up port forwarding. To do that run:

kubectl port-forward cb-example-0000 8091:8091

Leave that command running:

portforward

Now open up a browser to http://localhost:8091

loginscreen

The username is Administrator and password is password. And now you're in!

webui