This article is a continuance of [1]. Purpose of this article is to document the steps, issues and solutions to those issues we have to face when installing gluster in EKS (Elastic Kubernetes Service).
For gluster we need a disk to be attached with the K8s node. In EKS easiest way of implementing this is, adding it to the node configuration. So every time a node comes up, it comes up with a disk attached to the defined path. You can use this path in the topology.josn as mentioned in [1].
Next step is to install gluster using the gk-deploy script. The challenge comes here after. To use gluster in pods, you need to define a storage class. The heketi url mentioned in the storage class definition, should be accessible from master node. But the given heketi url is a cluster IP type k8s service. But in EKS deployments masters are managed by AWS and master don't have access to cluster IPs. So how we can solve this? Actually I tried to contact AWS support on this and I didn't got the answer from them. That lead to finding the answer by my own.
I created a LoadBalancer type k8s service in k8s fronting actual heketi service. First I started with external lb type but that let anyone outside the network access my heketi. Then I tried internal load balancer type. Then again I came to the original place. But this time I was able to make that internal lb type service accessible to the master by adding all my nodes to the same VPC as my master is in. And it allowed me to create the storage class without an issue and I could continue to create the PVC and use it in pods. Definition looks like below.
Hope this helps. Good luck on your deployment.
[1] https://wdfdo1986.blogspot.com/2019/05/consuming-file-system-artifacts-from.html
For gluster we need a disk to be attached with the K8s node. In EKS easiest way of implementing this is, adding it to the node configuration. So every time a node comes up, it comes up with a disk attached to the defined path. You can use this path in the topology.josn as mentioned in [1].
Next step is to install gluster using the gk-deploy script. The challenge comes here after. To use gluster in pods, you need to define a storage class. The heketi url mentioned in the storage class definition, should be accessible from master node. But the given heketi url is a cluster IP type k8s service. But in EKS deployments masters are managed by AWS and master don't have access to cluster IPs. So how we can solve this? Actually I tried to contact AWS support on this and I didn't got the answer from them. That lead to finding the answer by my own.
I created a LoadBalancer type k8s service in k8s fronting actual heketi service. First I started with external lb type but that let anyone outside the network access my heketi. Then I tried internal load balancer type. Then again I came to the original place. But this time I was able to make that internal lb type service accessible to the master by adding all my nodes to the same VPC as my master is in. And it allowed me to create the storage class without an issue and I could continue to create the PVC and use it in pods. Definition looks like below.
apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 labels: glusterfs: heketi-deployment heketi: deployment name: heketi-external namespace: gluster spec: externalTrafficPolicy: Cluster ports: - port: 8080 protocol: TCP targetPort: 8080 selector: glusterfs: heketi-pod heketi: pod sessionAffinity: None type: LoadBalancer
Hope this helps. Good luck on your deployment.
[1] https://wdfdo1986.blogspot.com/2019/05/consuming-file-system-artifacts-from.html
Comments
Post a Comment