Skip to content

Instantly share code, notes, and snippets.

@zihaoyu
Last active September 13, 2017 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zihaoyu/f06491521aa410f2777afe636071e242 to your computer and use it in GitHub Desktop.
Save zihaoyu/f06491521aa410f2777afe636071e242 to your computer and use it in GitHub Desktop.
Pods seems to not be able to connect to ports of the minions they run on.

I have the following statsd DS and a service Deployment running. Notice the minion host name is passed to the service pods via downward API. Services pods send their metrics to the "local" statsd on the same minion.

However from our testing it looks like no metrics was received by statsd.

Related issue: https://github.com/projectcalico/cni-plugin/issues/323

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: my-service
name: my-service
spec:
template:
metadata:
labels:
app: my-service
name: my-service
spec:
containers:
- env:
- name: statsdHost
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: statsdPort
value: "8125"
image: my-service:1.0.0
name: my-service
resources:
requests:
cpu: 0.5
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: statsd
labels:
app: statsd
spec:
template:
metadata:
labels:
app: statsd
spec:
containers:
- name: statsd
image: statsd
ports:
- containerPort: 8125
hostPort: 8125
protocol: UDP
- containerPort: 8126
protocol: TCP
resources:
requests:
cpu: 0.1
limits:
cpu: 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment