nacos icon indicating copy to clipboard operation
nacos copied to clipboard

how to set ServiceEntry namespace by mcp-over-xds,i found it always nacos

Open yichouchou opened this issue 2 years ago • 24 comments

version: nacos@last [email protected]

i found ServiceEntry in istiod,but why its namespace is always nacos, i dont konw how to set it or it use nacos's namespace ; the nacos namespace is default,but ServiceEntry is nacos. i found codes in nacos IstioCrdUtil.java about buildServiceEntry, there is no setting aboult namespace.

yichouchou avatar Jul 19 '22 04:07 yichouchou

i can also use the ServiceEntry but it's not in the namespace i want.

yichouchou avatar Jul 19 '22 04:07 yichouchou

@SpecialYang Please help to check.

KomachiSion avatar Jul 21 '22 01:07 KomachiSion

Can you show the results of this following command on the istiod?

curl localhost:15014/debug/configz | grep ServiceEntry -C 20

SpecialYang avatar Jul 21 '22 02:07 SpecialYang

Can you show the results of this following command on the istiod?

curl localhost:15014/debug/configz | grep ServiceEntry -C 20

all about serviceentry from nacos's namespace is nacos

yichouchou avatar Jul 21 '22 03:07 yichouchou

Can you show the results of this following command on the istiod?

curl localhost:15014/debug/configz | grep ServiceEntry -C 20

the consumer and provider is all in namespace,but ServiceEntry is nacos;Codes in nacos IstioCrdUtil.java about buildServiceEntry, there is no setting aboult namespace. so where is the namespace setting?

yichouchou avatar Jul 21 '22 03:07 yichouchou

Could you paste these logs? I want to see what happens.

SpecialYang avatar Jul 21 '22 03:07 SpecialYang

Could you paste these logs? I want to see what happens.

i'm sorry that i can't find content of request from nacos in istiod.

yichouchou avatar Jul 21 '22 04:07 yichouchou

Could you paste these logs? I want to see what happens.

i'm sorry that i can't find content of request from nacos in istiod.

debug level

yichouchou avatar Jul 21 '22 04:07 yichouchou

Could you paste these logs? I want to see what happens.

i'm sorry that i can't find content of request from nacos in istiod.

debug level

yichouchou avatar Jul 21 '22 04:07 yichouchou

could you paste any ServiceEntry info in Istio?

YunWZ avatar Jul 22 '22 16:07 YunWZ

@YunWZ @SpecialYang @yichouchou I modified the namespace in nacos, the generated serviceentry namespace is id. how to get namespace name?

"kind": "ServiceEntry",
"apiVersion": "networking.istio.io/v1alpha3",
"metadata": {
    "name": "istio-demo-cloud-producer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
    "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
    "resourceVersion": "1",
    "creationTimestamp": "2022-08-03T02:33:45Z",
    "labels": {
        "registryType": "nacos"
    },
    "annotations": {
        "virtual": "1"
    }
}

jjluUp avatar Aug 03 '22 02:08 jjluUp

the namespace in nacos, the generated serviceentry namespace is id. how to get name It looks interesting,I have no idea but to create a namespace the ServiceEntry in,maybe we should try some other ways or fixed it.

yichouchou avatar Aug 03 '22 03:08 yichouchou

@YunWZ @SpecialYang @yichouchou I modified the namespace in nacos, the generated serviceentry namespace is id. how to get namespace name?

"kind": "ServiceEntry",
"apiVersion": "networking.istio.io/v1alpha3",
"metadata": {
    "name": "istio-demo-cloud-producer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
    "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
    "resourceVersion": "1",
    "creationTimestamp": "2022-08-03T02:33:45Z",
    "labels": {
        "registryType": "nacos"
    },
    "annotations": {
        "virtual": "1"
    }
}

The same namespace names are allowed in nacos, but the namespace id is unique. So we choose namespace id as the ServiceEntry's namespace. The alternative way is to set these namespace name as the labels of ServiceEntry. I will do this work later.

SpecialYang avatar Aug 03 '22 03:08 SpecialYang

@SpecialYang Hi, I try to modify metadata in nacos, data is not synced to serviceentry label. what should I do?

image

{
    "kind": "ServiceEntry",
    "apiVersion": "networking.istio.io/v1alpha3",
    "metadata": {
        "name": "istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
        "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
        "resourceVersion": "10",
        "creationTimestamp": "2022-08-03T02:49:45Z",
        "labels": {
            "registryType": "nacos"
        },
        "annotations": {
            "virtual": "1"
        }
    },
    "spec": {
        "endpoints": [{
            "address": "10.233.76.31",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }, {
            "address": "10.233.76.98",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }],
        "hosts": ["istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa.nacos"],
        "location": "MESH_INTERNAL",
        "ports": [{
            "name": "http",
            "number": 8864,
            "protocol": "HTTP"
        }],
        "resolution": "STATIC"
    }
}

jjluUp avatar Aug 03 '22 06:08 jjluUp

@SpecialYang Hi, I try to modify metadata in nacos, data is not synced to serviceentry label. what should I do?

image

{
    "kind": "ServiceEntry",
    "apiVersion": "networking.istio.io/v1alpha3",
    "metadata": {
        "name": "istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
        "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
        "resourceVersion": "10",
        "creationTimestamp": "2022-08-03T02:49:45Z",
        "labels": {
            "registryType": "nacos"
        },
        "annotations": {
            "virtual": "1"
        }
    },
    "spec": {
        "endpoints": [{
            "address": "10.233.76.31",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }, {
            "address": "10.233.76.98",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }],
        "hosts": ["istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa.nacos"],
        "location": "MESH_INTERNAL",
        "ports": [{
            "name": "http",
            "number": 8864,
            "protocol": "HTTP"
        }],
        "resolution": "STATIC"
    }
}

it's a bug and fixed in latest

yichouchou avatar Aug 03 '22 07:08 yichouchou

@SpecialYang Hi, I try to modify metadata in nacos, data is not synced to serviceentry label. what should I do? image

{
    "kind": "ServiceEntry",
    "apiVersion": "networking.istio.io/v1alpha3",
    "metadata": {
        "name": "istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
        "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
        "resourceVersion": "10",
        "creationTimestamp": "2022-08-03T02:49:45Z",
        "labels": {
            "registryType": "nacos"
        },
        "annotations": {
            "virtual": "1"
        }
    },
    "spec": {
        "endpoints": [{
            "address": "10.233.76.31",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }, {
            "address": "10.233.76.98",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }],
        "hosts": ["istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa.nacos"],
        "location": "MESH_INTERNAL",
        "ports": [{
            "name": "http",
            "number": 8864,
            "protocol": "HTTP"
        }],
        "resolution": "STATIC"
    }
}

it's a bug and fixed in latest

u can see it in #8767

yichouchou avatar Aug 03 '22 07:08 yichouchou

@SpecialYang Hi, I try to modify metadata in nacos, data is not synced to serviceentry label. what should I do? image

{
    "kind": "ServiceEntry",
    "apiVersion": "networking.istio.io/v1alpha3",
    "metadata": {
        "name": "istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa",
        "namespace": "5327d633-a320-4c16-b739-d8a34f12eaaa",
        "resourceVersion": "10",
        "creationTimestamp": "2022-08-03T02:49:45Z",
        "labels": {
            "registryType": "nacos"
        },
        "annotations": {
            "virtual": "1"
        }
    },
    "spec": {
        "endpoints": [{
            "address": "10.233.76.31",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }, {
            "address": "10.233.76.98",
            "labels": {
                "cluster": "DEFAULT",
                "preserved.register.source": "SPRING_CLOUD"
            },
            "ports": {
                "http": 8864
            },
            "weight": 1
        }],
        "hosts": ["istio-demo-consumer.DEFAULT-GROUP.5327d633-a320-4c16-b739-d8a34f12eaaa.nacos"],
        "location": "MESH_INTERNAL",
        "ports": [{
            "name": "http",
            "number": 8864,
            "protocol": "HTTP"
        }],
        "resolution": "STATIC"
    }
}

it's a bug and fixed in latest

I am using 2.1.0

jjluUp avatar Aug 03 '22 07:08 jjluUp

@yichouchou @SpecialYang It has been fixed?

jjluUp avatar Aug 03 '22 07:08 jjluUp

@yichouchou @SpecialYang It has been fixed?

it seems not merged to master,more in #8767

yichouchou avatar Aug 03 '22 07:08 yichouchou

@yichouchou thanks

jjluUp avatar Aug 03 '22 07:08 jjluUp

@yichouchou @SpecialYang Hi, Istio integrates nacos, can I still use istio for gray between services? I found that service discovery of nacos prevent this behavior

jjluUp avatar Aug 04 '22 01:08 jjluUp

@yichouchou @SpecialYang Hi, Istio integrates nacos, can I still use istio for gray between services? I found that service discovery of nacos prevent this behavior

maybe u can use DestinationRule and subsets by setting dff labels

yichouchou avatar Aug 04 '22 01:08 yichouchou

@yichouchou @SpecialYang Hi, Istio integrates nacos, can I still use istio for gray between services? I found that service discovery of nacos prevent this behavior

maybe u can use DestinationRule and subsets by setting dff labels because the business gateway has obtained ip access through service discovery of nacos, vs cannot intercept it

jjluUp avatar Aug 04 '22 01:08 jjluUp

It is not a good paradigm

yichouchou avatar Aug 04 '22 01:08 yichouchou

Thanks for your feedback and contribution. But the issue/pull request has not had recent activity more than 180 days. This issue/pull request will be closed if no further activity occurs 7 days later. We may solve this issue in new version. So can you upgrade to newest version and retry? If there are still issues or want to contribute again. Please create new issue or pull request again.

stale[bot] avatar Apr 02 '23 19:04 stale[bot]