Giter Club home page Giter Club logo

google-gke-couchbase's Introduction

google-gke-couchbase

This walkthrough will illustrate how simple it is to setup and manage Couchbase clusters using the Couchbase Operator within the Google Kubernetes Engine (GKE) on the Google Cloud Platform (GCP).

Install and Setup the gcloud CLI

We will need a GCP account and then we will install glcoud.

Setup your GCP Environment

We setup our environment with a single command (be sure to choose a default region):

gcloud init

Deploy a GKE Cluster

Deploying a GKE cluster is straightfoward, using the command:

gcloud container clusters create mycluster --machine-type=n1-standard-4    

Install and Setup kubectl

Now we have to install and set up kubectl, so it can connect to the GKE cluster. Two commands will do that for us:

gcloud components install kubectl
gcloud container clusters get-credentials mycluster

getcredentials

We verify our kubectl with:

kubectl get nodes

We now see that three node are running:

getnodes

Setup GKE Role-based Access Control (RBAC)

GKE supports RBAC in order to limit permissions. Since the Couchbase Operator creates resources in our GKE cluster, we will need to grant it the permission to do so.

We do that with the following commands:

kubectl create clusterrolebinding cluster-admin-binding \
  --clusterrole cluster-admin \
  --user $(gcloud config get-value account)

kubectl create clusterrolebinding my-couchbase \
  --clusterrole=cluster-admin \
  --serviceaccount=default:default

Deploying the Couchbase Operator

Now that we have all the environment prerequisites in place, we are ready to deploy the Couchbase Operator.

We deploy the Couchbase Operator and then verify it with the following commands:

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

We now can see that the Couchbase Operator is deployed.

operatordeployed

Deploying a Couchbase Cluster

We are now in the final stretch!

Next we will create a Couchbase cluster with the following commands:

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

We should be able to see something like this:

couchbasecreated

We can view the all of the pods by running:

kubectl get pods

getpods

Accessing the Couchbase Web UI

Now we have a Couchbase cluster running! To use the web console we will need setup port forwarding.

We do that with the kubectl command:

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

We need to make sure we leave the command running in the terminal:

portforward

Now we can open up a browser at http://localhost:8091

loginscreen

We will login using username=Administrator and password=password.

We are in! Click the 'Servers' link on the left side and we should see our clusters running.

webui

Fin

google-gke-couchbase's People

Contributors

benofben avatar sliburd avatar foxish avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.