Разрешение имени DNS не происходит в kubernetes - PullRequest
1 голос
/ 17 февраля 2020

Мы настроили кластер kubernetes с 3 узлами. Один хозяин, а двое - рабы. И установил zookeeper и active mq в главном узле. Когда мы видим журналы после развертывания нашего приложения, они показывают, что http://foo.bar.com: 2181 (активное mq DNS-имя) не может получить доступ или достичь. Если мы изменим это имя домена activemq на IP-адрес в файле свойств, оно будет работать нормально.

Я думаю, что разрешение имен не происходит в kubernetes, вы можете помочь, как я могу получить эту работу автоматически? потому что я не могу изменить файл свойств всегда, когда есть новое развертывание.

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.17.0 (0c01409)
  creationTimestamp: null
  labels:
    io.kompose.service:  config-service
  name:  config-service
spec:
  progressDeadlineSeconds: 2146593647
  replicas: 1
  revisionHistoryLimit: 2146593647
  selector:
    matchLabels:
      io.kompose.service: config-service
  strategy:
    type: Recreate
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service:  config-service
    spec:
      containers:
      - env:
        - name: CONFIG_DIR
          value: /tmp/work/
        - name: audit_file_path
          value: /tmp/work/logs/audit.log
        - name: spring_cloud_zookeeper_connectString
          value: 172.X.X.X:2181
        - name: cross_orgin_hosts
          value: http://172.X.X.X:3056;http://172.X.X.X:3056;http://172.X.X.X:3056
        image: nexus.repo.com:8098/config-service:1.1.0-2198
        imagePullPolicy: Always
        name:  config-service
        ports:
        - containerPort: 8088
          hostPort: 8088
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp/work/
          name:  config-service-claim0
      dnsPolicy: ClusterFirst
      hostNetwork: true
      nodeSelector:
         disktype: node1
      imagePullSecrets:
      - name: regcred
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /tmp/CONFIG_DIR
          type: ""
        name:  config-service-claim0
status: {}

---

apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.19.0 (f63a961c)
  creationTimestamp: null
  labels:
    io.kompose.service: config-service
  name: config-service
spec:
  ports:
  - name: "8088"
    port: 8088
    targetPort: 8088
  selector:
    io.kompose.service: config-service
status:
  loadBalancer: {}
...