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

Can't access daemon set pods via status.hostIP & hostPort #141

Closed
sanjitsaluja opened this issue Jul 29, 2018 · 3 comments
Closed

Can't access daemon set pods via status.hostIP & hostPort #141

sanjitsaluja opened this issue Jul 29, 2018 · 3 comments

Comments

@sanjitsaluja
Copy link

Problem I'm unable to access the status.hostIP from inside the pod container. This works just fine in GKE.

Setup
We are running FluentD daemon set.

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: logger-fluentd
  labels:
    name: logger
spec:
  template:
    metadata:
      labels:
        name: logger
    spec:
      containers:
        - image: <my_fluentd_image>
          name: logger-fluentd
          ports:
            - containerPort: 24224
              hostPort: 24224
              protocol: TCP
          resources:
            limits:
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 200Mi
          volumeMounts:
            - name: varlog
              mountPath: /var/log
      imagePullSecrets:
        - name: docker-login
      terminationGracePeriodSeconds: 30
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      volumes:
        - name: varlog
          hostPath:
            path: /var/log
  updateStrategy:
    type: RollingUpdate

Then the idea is to access these in individual pods. Here's how we inject the status.hostIP to our deployments.

   - name: LOGGER_SERVICE_HOST
    valueFrom:
        fieldRef:
          fieldPath: status.hostIP

Problem

telnet 192.168.39.18 24224
root@pod# telnet 192.168.39.18 24224
Trying 192.168.39.18...
telnet: Unable to connect to remote host: Connection refused
@igorvpcleao
Copy link

maybe related: #153

@jicowan
Copy link
Contributor

jicowan commented Aug 13, 2018

Why can't you exec into the pod?

@mogren
Copy link
Contributor

mogren commented Mar 15, 2019

Host port fix merged.

@mogren mogren closed this as completed Mar 15, 2019
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

4 participants