Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newbie question #4

Open
EricVS opened this issue Jan 19, 2018 · 2 comments
Open

Newbie question #4

EricVS opened this issue Jan 19, 2018 · 2 comments

Comments

@EricVS
Copy link

EricVS commented Jan 19, 2018

Hi,
I'm trying to use your template to setup Kafka/Zookeeper on Kubernetes but am having a hard time understanding the link between PersistentVolume and volumeClaimTemplates.
Would you mind commenting on how to create the PersistentVolume pointing to a local path?
I have this setup, but when I apply your manifest I get the error below...

apiVersion: v1
kind: PersistentVolume
metadata:
  name: datadir
  labels:
    type: local
spec:
  storageClassName: datadir
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    path: "/kubernetes/zk/config"

Error is:

PersistentVolumeClaim is not bound: "datadir-zk-0" (repeated 6 times)

and the Persistent Volume Claims stay in pending.

Any help is greatly appreciated.

Kind regards,

Eric V.

@sibtainabbas10
Copy link

I had the same issue. What I did was I created a PersistentVolume using

kind: PersistentVolume
apiVersion: v1
metadata:
  name: kafka-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/home/ec2-user/kafka-data"

Then in the kafka-config i added:

-----------
-----------
        volumeMounts:
        - name: kafka-pv-volume
          mountPath: /var/lib/kafka
-----------
-----------
  volumeClaimTemplates:
  - metadata:
      name: kafka-pv-volume
    spec:
      storageClassName: manual
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 2Gi

Let me know if that helps

@EricVS
Copy link
Author

EricVS commented Jan 23, 2018

Hi,
Thanks for your reply and feedback. I could get it to work with your solution but only on my localhost (Mac with Docker for Mac Beta with Kubernetes) When I tried to deploy on my Kubernetes cluster it failed. I fixed (worked around) by configuring GlusterFS and use that for PersistentVolume. Works like a charm with regards to the storage.
Zookeeper running perfectly but still an error when starting up Kafka not being able to get metadata from list (localhost:9093). Did you encounter that too?
Kind regards,

Eric V.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants