k3d icon indicating copy to clipboard operation
k3d copied to clipboard

[BUG] bad address issue when mounting nfs volume running in same cluster (using service domain i.e. .svc.cluster.local subdomain)

Open moinologics opened this issue 1 year ago • 0 comments

What did you do

  • How was the cluster created?

    • k3d cluster create $cluster_name -p "8082:80@server:0:direct" --k3s-arg "--disable=traefik@server:0"
  • What did you do afterwards? created one nfs server using yml provided and tried to mount nfs disk in new pod

What did you expect to happen

nfs volume should be mounted in pod and pod should start running

Screenshots or terminal output

Screenshot 2023-09-26 at 9 36 26 PM

although i'm able to connect to nfs container on all three ports in nfs server by telnet (from inside of another container running in same cluster)

Which OS & Architecture

arch: aarch64 cgroupdriver: cgroupfs cgroupversion: "2" endpoint: /var/run/docker.sock filesystem: extfs infoname: docker-desktop name: docker os: Docker Desktop ostype: linux version: 23.0.5

Which version of k3d

k3d version v5.6.0 k3s version v1.27.4-k3s1 (default)

Which version of docker

Server: Docker Desktop 4.19.0

nfs.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs
spec:
  selector:
    matchLabels:
      app: nfs
  template:
    metadata:
      labels:
        app: nfs
    spec:
      volumes:
        - name: external-storage
          persistentVolumeClaim:
            claimName: external-storage-pvc
      containers:
        - name: nfs
          image: k8s.gcr.io/volume-nfs:0.8
          ports:
            - name: nfs
              containerPort: 2049
            - name: mountd
              containerPort: 20048
            - name: rpcbind
              containerPort: 111
          securityContext:
            privileged: true
          resources:
            requests:
              memory: 128Mi
              cpu: 100m
            limits:
              memory: 512Mi
              cpu: 1000m
          volumeMounts:
            - name: external-storage
              mountPath: /exports
---
apiVersion: v1
kind: Service
metadata:
  name: nfs
spec:
  selector:
    app: nfs
  ports:
    - name: nfs
      port: 2049
    - name: mountd
      port: 20048
    - name: rpcbind
      port: 111

pod.yml

apiVersion: v1
kind: Pod
metadata:
  name: testa-app
  labels:
    name: testa-app
spec:
  volumes:
    - name: nfs
      nfs:
        server: nfs.default.svc.cluster.local
        path: /
  containers:
    - name: testa-app
      image: nginx:alpine-slim
      volumeMounts:
        - name: nfs
          mountPath: /tmp/nfs
      resources:
        limits:
          memory: 128Mi
          cpu: 500m
      ports:
        - containerPort: 80

moinologics avatar Sep 26 '23 16:09 moinologics