Couchbase Standalone Server Setup and Configuration on Kubernetes
This article will help you to learn how to deploy and configure couchbase server standalone on kubernetes cluster.
Prerequisites
- kubernetes cluster up and running
Standalone Setup
To setup the couchbase standalone server, we will create PVC to persist the data.
pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-data-couchbase
namespace: ns-couchbase
labels:
app: data-couchbase
env: dev
spec:
storageClassName: default
accessModes:
— ReadWriteOnce
resources:
requests:
storage: 20Gi
Now we will create the deployment file for the couchbase server, We are using couchbase community docker image form the docker hub.
couchbase-standalone.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: data-couchbase
env: dev
name: data-couchbase-standalone
namespace: ns-couchbase
spec:
replicas: 1
selector:
matchLabels:
app: data-couchbase
env: dev
template:
metadata:
labels:
app: data-couchbase
env: dev
spec:
containers:
- image: couchbase:community-6.6.0
imagePullPolicy: IfNotPresent
name: data-couchbase
volumeMounts:
- mountPath: /opt/couchbase/var
name: data-volume
volumes:
- persistentVolumeClaim:
claimName: pvc-data-couchbase
name: data-volume
To access the couchbase, we need to create service,
here we are using type loadbalancer service
svc.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: data-couchbase
env: dev
name: svc-data-couchbase
namespace: ns-couchbase
spec:
ports:
- name: tcp-web-cb
port: 8091
protocol: TCP
targetPort: 8091
- name: tcp-memcached-cb
port: 11210
protocol: TCP
targetPort: 11210
selector:
app: data-couchbase
env: dev
type: LoadBalancer
And Done, Apply the YAML files in order
kubectl apply -f pvc.yaml
kubectl apply -f couchbase-standalone.yaml
kubectl apply -f svc.yaml
Now with the loadbalancer service IP we can access the couchbase server
Server Configuration
When we browse the IP with port 8091 we we’ll see the below screen.
Click on “Setup New Cluster”, And fill the details like Cluster-name, Cluster admin user name and password,
Then click on accept terms and In next page click on “Configure Disk, Memory and Services”, Where you’ll be asked to configure hostname, service memory quota and disk paths.
Configure memory quotas as per your requirements or node limit and Click on Save & Finish !
Conclusion
I hope this guide helps you to configure the standalone couchbase server with configuration, Please refer the official couchbase website for more configurations and doubts.
Thanks !