Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which ip did ipaddr get? #277

Open
myifeng opened this issue Jul 22, 2022 · 3 comments
Open

Which ip did ipaddr get? #277

myifeng opened this issue Jul 22, 2022 · 3 comments

Comments

@myifeng
Copy link

myifeng commented Jul 22, 2022

ipaddr=172.18.32.149

image

But 172.18.32.149 is not my ip address, why is this?

@zmstone
Copy link
Member

zmstone commented Jul 22, 2022

hi.
we need more context
Where is this ip observed?

@zmstone
Copy link
Member

zmstone commented Jul 22, 2022

If this is from the logs. Likely because emqx (old version?) tried to resolve configured host name fqdn to ip address

@myifeng
Copy link
Author

myifeng commented Jul 23, 2022

I am using emqx in the k8s cluster,I see in my my-mqtt-auth logs that the ipaddr parameter is not as expected.

          name: emqx
          image: emqx/emqx:4.3.16
          ports:
            - name: mqtt
              containerPort: 1883
            - name: mqttssl
              containerPort: 8883
            - name: mgmt
              containerPort: 8081
            - name: ws
              containerPort: 8083
            - name: wss
              containerPort: 8084
            - name: dashboard
              containerPort: 18083
          env:
            - name: EMQX_NAME
              value: "emqx"
            - name: EMQX_CLUSTER__DISCOVERY
              value: "k8s"
            - name: EMQX_CLUSTER__K8S__APP_NAME
              value: "emqx"
            - name: EMQX_CLUSTER__K8S__SERVICE_NAME
              value: "emqx-headless"
            - name: EMQX_CLUSTER__K8S__ADDRESS_TYPE
              value: "hostname"
            - name: EMQX_CLUSTER__K8S__APISERVER
              value: "https://kubernetes.default.svc:443"
            - name: EMQX_CLUSTER__K8S__SUFFIX
              value: "svc.cluster.local"
            - name: EMQX_CLUSTER__K8S__NAMESPACE
              value: "default"
            - name: EMQX_LOADED_PLUGINS
              value: "emqx_recon,emqx_retainer,emqx_management,emqx_dashboard,emqx_auth_http"
            - name: EMQX_AUTH__HTTP__AUTH_REQ__URL
              value: "http://my-mqtt-auth:8080/auth/user"
            - name: EMQX_AUTH__HTTP__AUTH_REQ__METHOD
              value: "post"
            - name: EMQX_AUTH__HTTP__AUTH_REQ__HEADERS__CONTENT_TYPE
              value: "application/json"
            - name: EMQX_AUTH__HTTP__AUTH_REQ__PARAMS
              value: "username=%u,password=%P,clientId=%c,ipaddr=%a"       

ingress.yaml

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: emqx
  annotations:
    kubernetes.io/ingress.class: "nginx"
  namespace: default
spec:
  rules:
    - host: emqx.domain.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: emqx-service
                port:
                  number: 18083

ingress-tcp-udp-proxy.yaml

# tcp-data.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: ingress-nginx
data:
# <namespace/service name>:<service port>:[PROXY]:[PROXY]
  1883: "default/emqx-service:1883"
  8883: "default/emqx-service:8883"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: udp-services
  namespace: ingress-nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants