ExternalWorkload's Endpoint not getting a resolved IP to VM #12873
-
Hello. Thanks for everyone's help on slack for all the initial debugging! I am trying to mostly follow this. Our POC is located on a legacy GKE cluster. This caveat means it is NOT VPC-native (and thus direct VM to pod IP communication will not work). Because of this, I have done two additional things to get to where I am now:
apiVersion: v1
kind: Service
metadata:
annotations:
networking.gke.io/load-balancer-type: "Internal"
component: destination
name: linkerd-ext-lb
namespace: linkerd
spec:
ports:
- name: dst
port: 8086
protocol: TCP
targetPort: 8086
- name: policy
port: 8090
protocol: TCP
targetPort: 8090
selector:
linkerd.io/control-plane-component: destination
sessionAffinity: None
type: LoadBalancer
10.156.0.82 linkerd-dst-headless.linkerd.svc.cluster.local
10.156.0.82 linkerd-policy.linkerd.svc.cluster.local
The following is what was deployed for the VM to connect in.
./bin/spire-server entry create -parentID spiffe://root.linkerd.cluster.local/agent \
-spiffeID spiffe://root.linkerd.cluster.local/external-workload -selector unix:uid:$(id -u root) confirmed with: ./bin/spire-server entry show -spiffeID "spiffe://root.linkerd.cluster.local/external-workload"
Found 1 entry
Entry ID : 4fa420bd-a7ab-4245-9d54-1306f1d7d6e9
SPIFFE ID : spiffe://root.linkerd.cluster.local/external-workload
Parent ID : spiffe://root.linkerd.cluster.local/agent
Revision : 0
X509-SVID TTL : default
JWT-SVID TTL : default
Selector : unix:uid:0 apiVersion: workload.linkerd.io/v1beta1
kind: ExternalWorkload
metadata:
name: external-workload
namespace: linkerd
labels:
location: vm
app: legacy-app
workload_name: external-workload
spec:
meshTLS:
identity: "spiffe://root.linkerd.cluster.local/external-workload"
serverName: "external-workload.linkerd.cluster.local"
workloadIPs:
- ip: 10.156.0.81
ports:
- port: 8080
name: http
status:
conditions:
- type: Ready
status: "True"
lastTransitionTime: "2024-01-24T11:53:43Z"
reason: "Alive"
message: "This workload is alive"
---
apiVersion: v1
kind: Service
metadata:
name: external-workload
namespace: linkerd
spec:
type: ClusterIP
selector:
workload_name: external-workload
ports:
- port: 8080
protocol: TCP
name: http
---
apiVersion: policy.linkerd.io/v1beta2
kind: Server
metadata:
name: external-workloads
namespace: linkerd
annotations:
config.linkerd.io/default-inbound-policy: allow
spec:
externalWorkloadSelector:
matchLabels:
workload_name: external-workload
port: http
proxyProtocol: HTTP/1 I am now able to curl from the VM into the cluster via a K8s endpoint (an example echo server endpoint that's mesh'd): curl -v echo-server.default.svc.cluster.local:10360
* Trying 10.67.242.22:10360...
* Connected to echo-server.default.svc.cluster.local (10.67.242.22) port 10360 (#0)
> GET / HTTP/1.1
> Host: echo-server.default.svc.cluster.local:10360
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< content-type: application/json; charset=utf-8
< x-trace-id: 0ee03a8af4c4037663d18280b44c6f9c
< date: Mon, 22 Jul 2024 13:05:46 GMT
< content-length: 205
<
{
"headers": {
"accept": "*/*",
"host": "echo-server.default.svc.cluster.local:10360",
"user-agent": "curl/7.88.1"
},
"method": "GET",
"path": "/",
"query": ""
* Connection #0 to host echo-server.default.svc.cluster.local left intact
} However, I am not able to curl from the echo-server (get 504 and eventually 503s). Running NAME ENDPOINTS AGE
external-workload <none> 2d23h
kube-dns-int-lb 10.64.23.14:5353 2d21h
linkerd-dst 10.64.0.17:8086 5d
linkerd-dst-headless 10.64.0.17:8086 5d
linkerd-ext-lb 10.64.0.17:8086,10.64.0.17:8090 3d19h
linkerd-gateway 10.64.4.16:4191,10.64.4.16:4143 4d22h
linkerd-identity 10.64.18.21:8080 5d
linkerd-identity-headless 10.64.18.21:8080 5d
linkerd-policy 10.64.0.17:8090 5d
linkerd-policy-validator 10.64.0.17:9443 5d
linkerd-proxy-injector 10.64.18.25:8443 5d
linkerd-sp-validator 10.64.0.17:8443 5d
metrics-api 10.64.11.26:8085 4d23h
tap 10.64.11.28:8088,10.64.11.28:8089 4d23h
tap-injector 10.64.11.16:8443 4d23h
web 10.64.0.12:9994,10.64.0.12:8084 4d23h If I try and dig deeper into that object with apiVersion: v1
kind: Endpoints
metadata:
annotations:
endpoints.kubernetes.io/last-change-trigger-time: "2024-07-19T13:15:26Z"
creationTimestamp: "2024-07-19T13:15:26Z"
name: external-workload
namespace: linkerd
resourceVersion: "960348867"
uid: 6338ac3d-9d5a-46dd-a693-59091dd9bfa4 I've turned on debug logging on the policy and destination container's to see if there's anything that pops out, but I do not see much. What parts of this deployment resolve the finalized Endpoint? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hey @SamKirsch10! Several things come immediately to mind here:
|
Beta Was this translation helpful? Give feedback.
Hey @SamKirsch10! Several things come immediately to mind here:
kubectl get externalworkload -n linkerd external-workload -o yaml
?linkerd
namespace – generally speaking,linkerd
is for Linkerd itself, and things for your application should go in some other namespace. (I don't know that this would break things, but if you put app resources in thelinkerd
namespace you're going to regret it -- maybe not today, maybe not tomorrow, but s…