problem with edge server registration in Eureka

23 views Asked by At

I ran into a problem when I decided to make an edge server for microservices, but I ran into the problem that my microservice cannot register in Eureka, what could be wrong?

apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap
data:
  foodcataloguedb_url: jdbc:postgresql://35.228.167.123:5432/foodcataloguedb
  restaurantdb_url: jdbc:postgresql://35.228.167.123:5432/restaurantdb
  userdb_url: jdbc:postgresql://35.228.167.123:5432/userdb
  EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: "http://eureka:8761/eureka/"
  GATEWAY_APPLICATION_NAME: gateway
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gateway
  labels:
    app: gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gateway
  template:
    metadata:
      labels:
        app: gateway
    spec:
      containers:
        - name: gateway
          image: kirsing123/gateway:v1.4
          imagePullPolicy: Always
          ports:
            - containerPort: 8072
          env:
            - name: SPRING_APPLICATION_NAME
              valueFrom:
               configMapKeyRef:
                    name: configmap
                    key: GATEWAY_APPLICATION_NAME
            - name: EUREKA_CLIENT_SERVICEURL_DEFAULTZONE
              valueFrom:
                configMapKeyRef:
                  name: configmap
                  key: EUREKA_CLIENT_SERVICEURL_DEFAULTZONE
---
apiVersion: v1
kind: Service
metadata:
  name: gateway
spec:
  selector:
    app: gateway
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 8072
      targetPort: 8072

Errors

Eureka Dashboard

I changed dependencies and turned the @EnableDiscoveryClient annotation on and off, to no avail

0

There are 0 answers