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

Failed to access the cluster IP of other applications in the cluster within the Pod #8

Closed
ty-dc opened this issue Mar 14, 2023 · 3 comments
Labels
kind/bug Something isn't working

Comments

@ty-dc
Copy link

ty-dc commented Mar 14, 2023

What happend:
Failed to access the cluster IP of other applications in the cluster within the Pod

What you expected to happen:
Access to the cluster IP of other applications in the cluster from within the Pod

How to reproduce it (as minimally and precisely as possible):

  1. create multus network-attachment-definition CRD: macvlan-conf
cat <<EOF | kubectl apply -f -
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf
  namespace: kube-system
spec:
  config: |-
    {
        "cniVersion": "0.3.1",
        "name": "macvlan-conf",
        "plugins": [
            {
                "type": "macvlan",
                "master": "eth0",
                "mode": "bridge",
                "ipam": {
                    "type": "spiderpool"
                }
            },{
                  "type": "veth",
                  "service_cidr": ["10.96.0.0/16"]
              }
        ]
    }
EOF
  1. Creating Pods and using annotations:"v1.multus-cni.io/default-network"
cat <<EOF | kubectl create -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: custom-ippool-deploy
spec:
  replicas: 2
  selector:
    matchLabels:
      app: custom-ippool-deploy
  template:
    metadata:
      annotations:
        ipam.spidernet.io/ippool: |-
          {
            "ipv4": ["default-v4-ippool"]
          }
        v1.multus-cni.io/default-network: kube-system/macvlan-conf
      labels:
        app: custom-ippool-deploy
    spec:
      containers:
      - name: custom-ippool-deploy
        image: ghcr.io/daocloud/dao-2048:v1.2.0
        imagePullPolicy: IfNotPresent
        ports:
        - name: http
          containerPort: 80
          protocol: TCP
EOF
  1. Create a service
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Service
metadata:
  name: custom-ippool-svc
  labels:
    app: custom-ippool-deploy
spec:
  type: ClusterIP
  ports:
    - port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: custom-ippool-deploy
EOF
  1. access service IP
> kubectl exec -ti  custom-ippool-deploy-66d4669dd5-j97rc -- sh

/ # curl 10.96.100.43:80 -I
Connection refused

Anything else we need to know?:

@github-actions
Copy link

Hi @ty-dc, Thanks for opening an issue! Please use '/kind '(for example: /kind bug) to label this issue.

@ty-dc
Copy link
Author

ty-dc commented Mar 14, 2023

/kind bug

@github-actions github-actions bot added the kind/bug Something isn't working label Mar 14, 2023
@cyclinder
Copy link
Collaborator

Thanks for the report @ty-dc .

This is fixed by #5

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants