I am trying to install DSE Opscenter on Kubernetes.
Below is my cluster file
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ops-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Retain
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-storage-0
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
claimRef:
name: config-clusters-volume-opscenter-0
volumeMode: Filesystem
storageClassName: ops-storage
local:
path: /data/k8s-data/cassandra-0
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- ubuntuserver
---
apiVersion: v1
kind: Service
metadata:
name: opscenter-ext-lb
labels:
app: opscenter
spec:
type: LoadBalancer
ports:
- port: 8888
name: opsc-gui-port
- port: 8443
name: opsc-secure-port
selector:
app: opscenter
---
apiVersion: v1
kind: Service
metadata:
name: opscenter
labels:
app: opscenter
spec:
ports:
- port: 8888
name: opsc-gui-port
- port: 8443
name: opsc-secure-port
- port: 61620
name: port-61620
clusterIP: None
selector:
app: opscenter
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: opscenter
spec:
serviceName: "opscenter"
replicas: 1
selector:
matchLabels:
app: opscenter
podManagementPolicy: OrderedReady
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: opscenter
spec:
containers:
- name: opscenter
image: gcr.io/datastax-public/dse-opscenter:6.5.0
imagePullPolicy: IfNotPresent
lifecycle:
postStart:
exec:
command: ["/update_admin_password.sh"]
resources:
requests:
cpu: "2"
memory: "4000Mi"
env:
- name: DS_LICENSE
value: accept
- name: OPSC_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: opsc
key: admin_password
ports:
- containerPort: 8888
name: opsc-gui-port
- containerPort: 61620
name: port-61620
volumeMounts:
- name: config-volume
mountPath: /config
- name: config-clusters-volume
mountPath: /opt/opscenter/conf/clusters
- name: ssl-store-volume
mountPath: /var/lib/opscenter/ssl
volumes:
- name: config-volume
configMap:
name: opsc-config
- name: ssl-store-volume
configMap:
name: opsc-ssl-config
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- ubuntuserver
volumeClaimTemplates:
- metadata:
name: config-clusters-volume
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: ops-storage
resources:
requests:
storage: 10Gi
But I get the below error when I try to do so, I get the below error while listing the pods.
0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind.
I tried several ways but neither of them worked. Can someone please help me with this.
Any tutorial or link that shows how to install DSE Opscenter on Kubernetes would be helpful too.
Please note: I need to use local storage for the above.
Assuming you've installed DSE using the cass-operator, OpsCenter is not designed to be installed on a Kubernetes cluster and it's not a supported configuration. It will definitely not work.
The recommendation is to use open-source tools like https://github.com/datastax/metric-collector-for-apache-cassandra to monitor your cluster instead of OpsCenter.
For the same reason, K8ssandra.io has all these tools already bundled in and pre-configured when you launch Cassandra on Kubernetes:
K8ssandra uses the same cass-operator under the hood. Cheers!