You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/21 08:33:58 UTC

[GitHub] [apisix-ingress-controller] wjx8382 opened a new issue #478: request help: hostNetwork

wjx8382 opened a new issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478


   ### Issue description
   
   I added ```hostNetwork: true``` in the configuration file,then restart apisix,etcd can't start,logs error ```nc: bad address 'apisix-etcd.tfsmy-tools.svc.cluster.local'```
   
   ### Environment
   
   * your apisix-ingress-controller version (0.5.0);
   * your Kubernetes cluster version (Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.7", GitCommit:"be3d344ed06bff7a4fc60656200a93c74f31f9a4", GitTreeState:"clean", BuildDate:"2020-02-11T19:34:02Z", GoVersion:"go1.13.6", Compiler:"gc", Platform:"linux/amd64"}
   Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.7", GitCommit:"be3d344ed06bff7a4fc60656200a93c74f31f9a4", GitTreeState:"clean", BuildDate:"2020-02-11T19:24:46Z", GoVersion:"go1.13.6", Compiler:"gc", Platform:"linux/amd64"});
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] tokers commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-845784271


   @wjx8382 Please check out https://github.com/flannel-io/flannel/issues/1243, it should be related with networking route table settings, basically it should not be a problem caused by APISIX or apisix ingress controller.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-846053523


   If you using `hostNetwork: true` , you should change the dnsPolicy to `dnsPolicy: ClusterFirstWithHostNet`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] wjx8382 commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
wjx8382 commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-845788219


   > @wjx8382 Please check out [flannel-io/flannel#1243](https://github.com/flannel-io/flannel/issues/1243), it should be related with networking route table settings, basically it should not be a problem caused by APISIX or apisix ingress controller.
   
   But I added same config in apisix-ingress-controller,it is no problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] tokers commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-845788840


   > > @wjx8382 Please check out [flannel-io/flannel#1243](https://github.com/flannel-io/flannel/issues/1243), it should be related with networking route table settings, basically it should not be a problem caused by APISIX or apisix ingress controller.
   > 
   > But I added same config in apisix-ingress-controller,it is no problem.
   
   Which configs were added? Could you please paste the related context?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] wjx8382 commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
wjx8382 commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-845796370


   > > > @wjx8382 Please check out [flannel-io/flannel#1243](https://github.com/flannel-io/flannel/issues/1243), it should be related with networking route table settings, basically it should not be a problem caused by APISIX or apisix ingress controller.
   > > 
   > > 
   > > But I added same config in apisix-ingress-controller,it is no problem.
   > 
   > Which configs were added? Could you please paste the related context?
   
   Both added ```hostNetwork: true```
   
   APISIX config:
   ```
   kind: Deployment
   apiVersion: apps/v1
   metadata:
     name: apisix
     namespace: tools
     labels:
       app.kubernetes.io/instance: apisix
       app.kubernetes.io/managed-by: Helm
       app.kubernetes.io/name: apisix
       app.kubernetes.io/version: 2.5.0
       helm.sh/chart: apisix-0.3.2
     annotations:
       deployment.kubernetes.io/revision: '8'
       meta.helm.sh/release-name: apisix
       meta.helm.sh/release-namespace: tools
   spec:
     replicas: 1
     selector:
       matchLabels:
         app.kubernetes.io/instance: apisix
         app.kubernetes.io/name: apisix
     template:
       metadata:
         creationTimestamp: null
         labels:
           app.kubernetes.io/instance: apisix
           app.kubernetes.io/name: apisix
         annotations:
           checksum/config: b735005fd62683de84283ace7361cb2ef7f0f12b6833d067a17d29fd1ddd5dee
           kubectl.kubernetes.io/restartedAt: '2021-05-18T17:03:12+08:00'
           kubesphere.io/restartedAt: '2021-05-18T09:06:10.668Z'
       spec:
         volumes:
           - name: apisix-config
             configMap:
               name: apisix
               defaultMode: 420
         initContainers:
           - name: wait-etcd
             image: 'busybox:1.28'
             command:
               - sh
               - '-c'
               - >-
                 until nc -z apisix-etcd.tools.svc.cluster.local 2379; do
                 echo waiting for etcd `date`; sleep 2; done;
             resources: {}
             terminationMessagePath: /dev/termination-log
             terminationMessagePolicy: File
             imagePullPolicy: IfNotPresent
         containers:
           - name: apisix
             image: 'apache/apisix:2.5-alpine'
             ports:
               - name: http
                 hostPort: 9080
                 containerPort: 9080
                 protocol: TCP
               - name: tls
                 hostPort: 9443
                 containerPort: 9443
                 protocol: TCP
               - name: admin
                 hostPort: 9180
                 containerPort: 9180
                 protocol: TCP
             resources:
               limits:
                 cpu: '2'
               requests:
                 cpu: 50m
             volumeMounts:
               - name: apisix-config
                 mountPath: /usr/local/apisix/conf/config.yaml
                 subPath: config.yaml
             readinessProbe:
               tcpSocket:
                 port: 9080
               initialDelaySeconds: 10
               timeoutSeconds: 1
               periodSeconds: 10
               successThreshold: 1
               failureThreshold: 6
             lifecycle:
               preStop:
                 exec:
                   command:
                     - /bin/sh
                     - '-c'
                     - sleep 30
             terminationMessagePath: /dev/termination-log
             terminationMessagePolicy: File
             imagePullPolicy: IfNotPresent
             securityContext: {}
         restartPolicy: Always
         terminationGracePeriodSeconds: 30
         dnsPolicy: ClusterFirst
         hostNetwork: true
         securityContext: {}
         schedulerName: default-scheduler
     strategy:
       type: RollingUpdate
       rollingUpdate:
         maxUnavailable: 25%
         maxSurge: 25%
     revisionHistoryLimit: 10
     progressDeadlineSeconds: 600
   ```
   
   apisix-ingress-controller config:
   ```
   kind: Deployment
   apiVersion: apps/v1
   metadata:
     name: apisix-ingress-controller
     namespace: tools
     labels:
       app.kubernetes.io/instance: apisix-ingress-controller
       app.kubernetes.io/managed-by: Helm
       app.kubernetes.io/name: apisix-ingress-controller
       app.kubernetes.io/version: 0.5.0
       helm.sh/chart: apisix-ingress-controller-0.4.0
     annotations:
       deployment.kubernetes.io/revision: '3'
       meta.helm.sh/release-name: apisix-ingress-controller
       meta.helm.sh/release-namespace: tools
   spec:
     replicas: 1
     selector:
       matchLabels:
         app.kubernetes.io/instance: apisix-ingress-controller
         app.kubernetes.io/name: apisix-ingress-controller
     template:
       metadata:
         creationTimestamp: null
         labels:
           app.kubernetes.io/instance: apisix-ingress-controller
           app.kubernetes.io/name: apisix-ingress-controller
         annotations:
           checksum/config: 5f56e67d79de559dec3934c5e39a4dec62bf0cea686f742e1821587a6961a67a
           kubesphere.io/restartedAt: '2021-05-18T09:14:00.574Z'
       spec:
         volumes:
           - name: configuration
             configMap:
               name: apisix-ingress-controller-configmap
               items:
                 - key: config.yaml
                   path: config.yaml
               defaultMode: 420
         containers:
           - name: apisix-ingress-controller
             image: 'apache/apisix-ingress-controller:0.5.0'
             command:
               - /ingress-apisix/apisix-ingress-controller
               - ingress
               - '--config-path'
               - /ingress-apisix/conf/config.yaml
             ports:
               - name: http
                 hostPort: 8080
                 containerPort: 8080
                 protocol: TCP
             env:
               - name: POD_NAMESPACE
                 valueFrom:
                   fieldRef:
                     apiVersion: v1
                     fieldPath: metadata.namespace
               - name: POD_NAME
                 valueFrom:
                   fieldRef:
                     apiVersion: v1
                     fieldPath: metadata.name
             resources: {}
             volumeMounts:
               - name: configuration
                 mountPath: /ingress-apisix/conf
             livenessProbe:
               httpGet:
                 path: /healthz
                 port: 8080
                 scheme: HTTP
               timeoutSeconds: 1
               periodSeconds: 10
               successThreshold: 1
               failureThreshold: 3
             readinessProbe:
               httpGet:
                 path: /healthz
                 port: 8080
                 scheme: HTTP
               timeoutSeconds: 1
               periodSeconds: 10
               successThreshold: 1
               failureThreshold: 3
             terminationMessagePath: /dev/termination-log
             terminationMessagePolicy: File
             imagePullPolicy: IfNotPresent
         restartPolicy: Always
         terminationGracePeriodSeconds: 30
         dnsPolicy: ClusterFirst
         serviceAccountName: apisix-ingress-controller
         serviceAccount: apisix-ingress-controller
         hostNetwork: true
         securityContext: {}
         schedulerName: default-scheduler
     strategy:
       type: RollingUpdate
       rollingUpdate:
         maxUnavailable: 25%
         maxSurge: 25%
     revisionHistoryLimit: 10
     progressDeadlineSeconds: 600
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] wjx8382 closed issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
wjx8382 closed issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] tokers commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-845801546


   Not sure whether this is caused by the CNI plugin that you're using. @wjx8382 Could you show some details?
   
   @tao12345666333 Are you familiar with this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] wjx8382 commented on issue #478: request help: hostNetwork

Posted by GitBox <gi...@apache.org>.
wjx8382 commented on issue #478:
URL: https://github.com/apache/apisix-ingress-controller/issues/478#issuecomment-846705080


   > If you using `hostNetwork: true` , you should change the dnsPolicy to `dnsPolicy: ClusterFirstWithHostNet`
   
   It is resolved,thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org