examples icon indicating copy to clipboard operation
examples copied to clipboard

NFS example using hard coded IP rather than service

Open day1118 opened this issue 8 years ago • 20 comments

Why does the NFS example use a hard coded IP rather than a service. Can you please add a note of why this is the case?

Thanks

day1118 avatar May 25 '18 08:05 day1118

yeah theres a few hiccups when trying to move away from static ips to service which is undocumented

ekhaydarov avatar Jun 18 '18 10:06 ekhaydarov

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Sep 16 '18 11:09 fejta-bot

/remove-lifecycle stale

Is anyone able to document the undocumented stuff please?

walterdolce avatar Oct 14 '18 17:10 walterdolce

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Jan 12 '19 18:01 fejta-bot

/remove-lifecycle stale

I am also running into this problem and would really appreciate if anyone could document why we can't use Kubernetes services to connect to the NFS server.

@fejta are you able to help here?

abeckDev avatar Jan 28 '19 16:01 abeckDev

/remove-lifecycle stale

If we are forced to define the NFS based PV using an IP address rather than service DNS does anyone have a reference to docs on how to fix the IP address of a pod?

Of course, doing so is extremely unpleasant.

https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/ The Pods’ ordinals, hostnames, SRV records, and A record names have not changed, but the IP addresses associated with the Pods may have changed. In the cluster used for this tutorial, they have. This is why it is important not to configure other applications to connect to Pods in a StatefulSet by IP address.

recipedude avatar Jan 30 '19 02:01 recipedude

Hi @recipedude as far as I know there is no way to set a static IP address for any Kubernetes Resource because it is against Kubernetes dynamic nature.

That is why this issue in my opinion so unpleasant and it would be nice to know why that happens.

abeckDev avatar Jan 30 '19 13:01 abeckDev

Hey @abeckDev, indeed.

Yet the NFS example https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-pv.yaml uses static IP address. Believe I am not the only one that has tried to use the service DNS name in the NFS based PV, only to find that it fails with unresolvable name service. However, it does work when using a static IP address manually entered. Yuck.

I do recall seeing an example of an IP being set statically in a k8s resource and immediately thought something along the lines of "oh man, that's just wrong", been hunting for where I saw that.

Found it, @kelseyhightower appears to be advocating setting a service to a predefined static IP on a service resource here: https://github.com/kelseyhightower/kubernetes-redis-cluster/blob/master/services/redis-2.yaml in the https://github.com/kelseyhightower/kubernetes-redis-cluster project that may have been used for a Redis on Kubernetes talk he did.

Maybe by tagging him here, this issue might get some love? :)

recipedude avatar Jan 30 '19 18:01 recipedude

That's it! I ran in the exact same issue and thought that that cant be the way. After looking at GitHub I was happy that there was already an issue and a confirmation from the K8s team but unfortunenatly it is kind of abandoned now.

But I think using the NFS example to provide a powerful IO and low latency share in the cluster is a realy cool feature so it would be great if that Issue get resolved. Because although its possible, assigning static IPs or copying the assigned IP from K8s isn't a real solution in my opinion.

abeckDev avatar Jan 30 '19 19:01 abeckDev

@abeckDev Copying the assigned IP as shown in the "official" example feels wrong on so many levels. Am guessing that any deployment using that any such configuration will inevitably break.

For the time being it appears that the lesser evil is to, even have trouble writing this, assign the containerized NFS server service resource a static IP as thus:

apiVersion: v1
kind: Service
metadata:
  name: nfs-shared
  namespace: shared
  labels:
    app: nfs-shared
spec:
  ports:
  - port: 2049
    name: nfs-shared
  selector:
    app: nfs-shared
  clusterIP: "10.96.254.254"

And the PV would appear something like:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-shared
  namespace: shared
  labels:
    bucket: shared
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  persistentVolumeReclaimPolicy: Retain
  accessModes: 
    - ReadWriteMany
  nfs:
#    server: nfs-shared-0.nfs-shared.shared.svc.cluster.local 
    server: 10.96.254.254
    path: /

Yuck; but at least it hopefully will not break when the NFS server pod is killed, restarted or moves from node to node. No idea how one even goes about choosing an IP address for this. It's gross but seems to work so far...

recipedude avatar Feb 02 '19 18:02 recipedude

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar May 03 '19 19:05 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten

fejta-bot avatar Jun 02 '19 20:06 fejta-bot

/remove-lifecycle rotten Even though I know that we might never get an response I will try one last desperate call to mark this issue as still active.

Could someone from the Kubernetes team take a look into this please?

abeckDev avatar Jun 02 '19 20:06 abeckDev

same problem here

danilorsilva avatar Jul 22 '19 16:07 danilorsilva

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Oct 20 '19 17:10 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten

fejta-bot avatar Nov 19 '19 17:11 fejta-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close

fejta-bot avatar Dec 19 '19 18:12 fejta-bot

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 19 '19 18:12 k8s-ci-robot

/reopen

QTU100 avatar Dec 26 '23 08:12 QTU100

@QTU100: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 26 '23 08:12 k8s-ci-robot