update to ip
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m46s

This commit is contained in:
matst80
2024-11-09 14:11:26 +01:00
parent f9d14f1d7f
commit 7e0f75bde5
3 changed files with 3 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: status.podIP fieldPath: status.podIP
- name: NODE_NAME - name: POD_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.name fieldPath: metadata.name

View File

@@ -122,7 +122,7 @@ func (s *PoolServer) Serve() *http.ServeMux {
return mux return mux
} }
var clientName = os.Getenv("NODE_NAME") var clientName = os.Getenv("POD_IP")
func main() { func main() {
// Create a new instance of the server // Create a new instance of the server

View File

@@ -35,7 +35,7 @@ func (k *K8sDiscovery) DiscoverInNamespace(namespace string) ([]string, error) {
} }
hosts := make([]string, 0, len(pods.Items)) hosts := make([]string, 0, len(pods.Items))
for _, pod := range pods.Items { for _, pod := range pods.Items {
hosts = append(hosts, pod.Name) hosts = append(hosts, pod.Status.PodIP)
} }
return hosts, nil return hosts, nil
} }