By gradlon
Hi,
Right now i am Testing DO Kubernetes and am starting to get my head around it. There is only one thing that i am missing. An easy way to add shared volumes between PODS.
I tried GlusterFS since I am Familiar with it and Kubernetes has build in support for it, but so fare i Failed to get it working.
The GlusterFS is fine but I get an Error when I try to mound it.
"All subvolumes are down. Going offline until atleast one of them comes back up. The message “E [MSGID: 101075] [common-utils.c:294:gf_resolve_ip6] 0-resolver: getaddrinfo failed (Name or service not known)”
I have read that Rook.io would be a alternative solution but am still hesitant.
Is there a way to use Gluster FS on DO Kubernetes ore are there any other solutions for my need Kind regards.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
For all those of you wondering. I found the Solution. One caveat, the endpoint has to be in the same namespace as the pod Consuming it.
---
apiVersion: v1
kind: Service
metadata:
name: glusterfs-cluster
namespace: global-storage
spec:
ports:
- port: 1
---
apiVersion: v1
kind: Endpoints
metadata:
name: glusterfs-cluster
namespace: default
subsets:
- addresses:
- ip: 10.135.112.37
ports:
- port: 1
- addresses:
- ip: 10.135.53.65
ports:
- port: 1
- addresses:
- ip: 10.135.26.91
ports:
- port: 1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.15.4
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html
name: nfs-vol
- mountPath: /data
name: glusterfsvol
volumes:
- name: nfs-vol
nfs:
server: glusterfs.cloud.integral-systems.ch
path: /globalshare
- name: glusterfsvol
glusterfs:
endpoints: glusterfs-cluster
path: globalshare
readOnly: false
Hope this helps :)
@gradlon , Still its not working for me with the equivalent code (considering different namespace not default namespace) . Did you configure StorageClass or Init-Container in the Deployment level? Pls let me know . Thanks in advance.
GlusterFS Native Storage Service for Kubernetes. gluster-kubernetes is a project to provide Kubernetes administrators a mechanism to easily deploy GlusterFS as a native storage service onto an existing Kubernetes cluster shareit apk.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.