Skip to content

Instantly share code, notes, and snippets.

@komamitsu
Last active April 30, 2023 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komamitsu/6995f05d4055d624971f7705820f4cfb to your computer and use it in GitHub Desktop.
Save komamitsu/6995f05d4055d624971f7705820f4cfb to your computer and use it in GitHub Desktop.

Start minikube

$ minikube start --cpus=4

Let's follow https://docs.k8ssandra.io/install/local/single-cluster-helm/ basically.

$ helm repo add k8ssandra https://helm.k8ssandra.io/stable
$ helm repo add jetstack https://charts.jetstack.io
$ helm repo update

$ helm install cert-manager jetstack/cert-manager \
     --namespace cert-manager --create-namespace --set installCRDs=true

$ helm install k8ssandra-operator k8ssandra/k8ssandra-operator -n k8ssandra-operator --create-namespace
$ kubectl get pods -n k8ssandra-operator
NAME                                                READY   STATUS    RESTARTS   AGE
k8ssandra-operator-858bb86995-8lb4b                 1/1     Running   0          2m19s
k8ssandra-operator-cass-operator-75cf5776db-98l9t   1/1     Running   0          2m19s
$ kubectl get deployment -n k8ssandra-operator
NAME                               READY   UP-TO-DATE   AVAILABLE   AGE
k8ssandra-operator                 1/1     1            1           2m46s
k8ssandra-operator-cass-operator   1/1     1            1           2m46s
$ vi k8c1.yml

k8c1.yml

apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
  name: demo
spec:
  cassandra:
    serverVersion: "4.1.1"
    datacenters:
      - metadata:
          name: dc1
        size: 3
        initContainers:
          - name: server-config-init
            resources:
              requests:
                cpu: 500m
                memory: 512M
              limits:
                cpu: 500m
                memory: 512M
        softPodAntiAffinity: true
        resources:
           requests:
              cpu: 500m
              memory: 1536M
           limits:
              cpu: 500m
              memory: 2G
        storageConfig:
          cassandraDataVolumeClaimSpec:
            storageClassName: standard
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 5Gi
        config:
          jvmOptions:
            heapSize: 1G
$ diff k8c1.yml.orig k8c1.yml
7c7
<     serverVersion: "4.0.1"
---
>     serverVersion: "4.1.1"
11a12,28
>         initContainers:
>           - name: server-config-init
>             resources:
>               requests:
>                 cpu: 500m
>                 memory: 512M
>               limits:
>                 cpu: 500m
>                 memory: 512M
>         softPodAntiAffinity: true
>         resources:
>            requests:
>               cpu: 500m
>               memory: 1536M
>            limits:
>               cpu: 500m
>               memory: 2G
22,25c39
<             heapSize: 512M
<         stargate:
<           size: 1
<           heapSize: 256M
---
>             heapSize: 1G

$ kubectl apply -n k8ssandra-operator -f k8c1.yml
$ kubectl get pods -n k8ssandra-operator
$ kubectl get pods -n k8ssandra-operator
NAME                                                READY   STATUS    RESTARTS   AGE
demo-dc1-default-sts-0                              2/2     Running   0          7m16s
demo-dc1-default-sts-1                              2/2     Running   0          7m16s
demo-dc1-default-sts-2                              2/2     Running   0          7m16s
k8ssandra-operator-858bb86995-8lb4b                 1/1     Running   0          5h25m
k8ssandra-operator-cass-operator-75cf5776db-98l9t   1/1     Running   0          5h25m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment