Skip to content

Commit c236285

Browse files
authored
Merge pull request kubernetes#93492 from zshihang/nolocal
bind metadata proxy to 0.0.0.0
2 parents d2a0b6f + 38f040c commit c236285

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cluster/addons/metadata-proxy/gce/metadata-proxy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ spec:
4444
containers:
4545
- name: metadata-proxy
4646
image: k8s.gcr.io/metadata-proxy:v0.1.12
47+
args: ["--addr=0.0.0.0:988"]
4748
securityContext:
4849
privileged: true
4950
# Request and limit resources to get guaranteed QoS.

cluster/gce/gci/configure-helper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function config-ip-firewall {
173173
# node because we don't expect the daemonset to run on this node.
174174
if [[ "${ENABLE_METADATA_CONCEALMENT:-}" == "true" ]] && [[ ! "${METADATA_CONCEALMENT_NO_FIREWALL:-}" == "true" ]]; then
175175
echo "Add rule for metadata concealment"
176-
iptables -w -t nat -I PREROUTING -p tcp -d "${METADATA_SERVER_IP}" --dport 80 -m comment --comment "metadata-concealment: bridge traffic to metadata server goes to metadata proxy" -j DNAT --to-destination 127.0.0.1:988
176+
iptables -w -t nat -I PREROUTING -p tcp ! -i eth0 -d "${METADATA_SERVER_IP}" --dport 80 -m comment --comment "metadata-concealment: bridge traffic to metadata server goes to metadata proxy" -j REDIRECT --to-ports 988
177177
fi
178178

179179
# Log all metadata access not from approved processes.
@@ -940,7 +940,7 @@ EOF
940940
limitedResources:
941941
- resource: pods
942942
matchScopes:
943-
- scopeName: PriorityClass
943+
- scopeName: PriorityClass
944944
operator: In
945945
values: ["system-node-critical", "system-cluster-critical"]
946946
EOF

0 commit comments

Comments
 (0)