Skip to content

Instantly share code, notes, and snippets.

@cjus
Created February 23, 2024 15:45
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 cjus/f410a4c9f18d404aedcb0300f12d6e74 to your computer and use it in GitHub Desktop.
Save cjus/f410a4c9f18d404aedcb0300f12d6e74 to your computer and use it in GitHub Desktop.
Redpanda Install on GKE

Redpanda Install on GKE

Derived from:

Add Redpanda repository

$ helm repo add redpanda https://charts.redpanda.com

Add Jetstack repo

$ helm repo add jetstack https://charts.jetstack.io

Update repos

$ helm repo update

Install cert-manager

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

Install the Redpanda Operator custom resource definitions (CRDs):

$ kubectl kustomize "https://github.com/redpanda-data/redpanda-operator//src/go/k8s/config/crd?ref=v2.1.14-23.3.4" > kustomize.yaml
$ kubectl apply -f kustomize.yaml

Deploy the Redpanda Operator:

$ helm upgrade --install redpanda-controller redpanda/operator --namespace redpanda --set image.tag=v2.1.14-23.3.4 --create-namespace --timeout 1h

Install a Redpanda custom resource

redpanda-cluster.yaml

apiVersion: cluster.redpanda.com/v1alpha1
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    external:
      domain: {domain.com}
    auth:
      sasl:
        enabled: true
        users:
          - name: {fake_name}
            password: {fake_password}
    storage:
      persistentVolume:
        enabled: true
        #storageClass: csi-driver-lvm-striped-xfs
$ kubectl apply -f redpanda-cluster.yaml --namespace redpanda

Verify deployment

$ kubectl get pod --namespace redpanda -o=custom-columns=NODE:.spec.nodeName,POD_NAME:.metadata.name -l app.kubernetes.io/component=redpanda-statefulset

View bound persistent storage

$ kubectl get persistentvolumeclaim --namespace redpanda -o custom-columns=NAME:.metadata.name,STATUS:.status.phase,STORAGECLASS:.spec.storageClassName

Install rpk on mac:

$ brew install redpanda-data/tap/redpanda

Create a user

https://docs.redpanda.com/current/deploy/deployment-option/self-hosted/kubernetes/gke-guide/?tab=tabs-3-macos#create-a-user

$ kubectl --namespace redpanda exec -ti redpanda-0 -c redpanda -- \
rpk acl user create moose-account \
-p {fake_password}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment