mirror of https://github.com/k3s-io/k3s
Merge pull request #54150 from ihmccreery/mdc-e2e
Automatic merge from submit-queue (batch tested with PRs 54112, 54150, 53816, 54321, 54338). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Enable metadata concealment for tests **What this PR does / why we need it**: Metadata concealment is going to beta for v1.9; enable it by default in tests. Also, just use `ENABLE_METADATA_CONCEALMENT` instead of two different vars. Work toward #8867. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: none **Special notes for your reviewer**: **Release note**: ```release-note Metadata concealment on GCE is now controlled by the `ENABLE_METADATA_CONCEALMENT` env var. See cluster/gce/config-default.sh for more info. ```pull/6/head
commit
abe9d2f736
|
@ -750,16 +750,6 @@ EOF
|
|||
if [ -n "${ENABLE_CUSTOM_METRICS:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
ENABLE_CUSTOM_METRICS: $(yaml-quote ${ENABLE_CUSTOM_METRICS})
|
||||
EOF
|
||||
fi
|
||||
if [ -n "${ENABLE_METADATA_PROXY:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
ENABLE_METADATA_PROXY: $(yaml-quote ${ENABLE_METADATA_PROXY})
|
||||
EOF
|
||||
fi
|
||||
if [ -n "${KUBE_FIREWALL_METADATA_SERVER:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
KUBE_FIREWALL_METADATA_SERVER: $(yaml-quote ${KUBE_FIREWALL_METADATA_SERVER})
|
||||
EOF
|
||||
fi
|
||||
if [ -n "${FEATURE_GATES:-}" ]; then
|
||||
|
|
|
@ -154,12 +154,16 @@ if [[ ${NETWORK_POLICY_PROVIDER:-} == "calico" ]]; then
|
|||
NODE_LABELS="${NODE_LABELS},projectcalico.org/ds-ready=true"
|
||||
fi
|
||||
|
||||
# Currently, ENABLE_METADATA_PROXY supports only "simple". In the future, we
|
||||
# may add other options.
|
||||
ENABLE_METADATA_PROXY="${ENABLE_METADATA_PROXY:-}"
|
||||
# Apply the right node label if metadata proxy is on.
|
||||
if [[ ${ENABLE_METADATA_PROXY:-} == "simple" ]]; then
|
||||
NODE_LABELS="${NODE_LABELS},beta.kubernetes.io/metadata-proxy-ready=true"
|
||||
# Enable metadata concealment by firewalling pod traffic to the metadata server
|
||||
# and run a proxy daemonset on nodes.
|
||||
#
|
||||
# TODO(#8867) Enable by default.
|
||||
ENABLE_METADATA_CONCEALMENT="${ENABLE_METADATA_CONCEALMENT:-false}" # true, false
|
||||
if [[ ${ENABLE_METADATA_CONCEALMENT:-} == "true" ]]; then
|
||||
# Put the necessary label on the node so the daemonset gets scheduled.
|
||||
NODE_LABELS="${NODE_LABELS},beta.kubernetes.io/metadata-proxy-ready=true"
|
||||
# Add to the provider custom variables.
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} ENABLE_METADATA_CONCEALMENT"
|
||||
fi
|
||||
|
||||
# Optional: Enable node logging.
|
||||
|
|
|
@ -205,9 +205,14 @@ if [[ ${NETWORK_POLICY_PROVIDER:-} == "calico" ]]; then
|
|||
NODE_LABELS="$NODE_LABELS,projectcalico.org/ds-ready=true"
|
||||
fi
|
||||
|
||||
# Apply the right node label if metadata proxy is on.
|
||||
if [[ ${ENABLE_METADATA_PROXY:-} == "simple" ]]; then
|
||||
NODE_LABELS="${NODE_LABELS},beta.kubernetes.io/metadata-proxy-ready=true"
|
||||
# Enable metadata concealment by firewalling pod traffic to the metadata server
|
||||
# and run a proxy daemonset on nodes.
|
||||
ENABLE_METADATA_CONCEALMENT="${ENABLE_METADATA_CONCEALMENT:-true}" # true, false
|
||||
if [[ ${ENABLE_METADATA_CONCEALMENT:-} == "true" ]]; then
|
||||
# Put the necessary label on the node so the daemonset gets scheduled.
|
||||
NODE_LABELS="${NODE_LABELS},beta.kubernetes.io/metadata-proxy-ready=true"
|
||||
# Add to the provider custom variables.
|
||||
PROVIDER_VARS="${PROVIDER_VARS:-} ENABLE_METADATA_CONCEALMENT"
|
||||
fi
|
||||
|
||||
# Optional: Enable node logging.
|
||||
|
|
|
@ -93,7 +93,7 @@ function config-ip-firewall {
|
|||
iptables -N KUBE-METADATA-SERVER
|
||||
iptables -I FORWARD -p tcp -d 169.254.169.254 --dport 80 -j KUBE-METADATA-SERVER
|
||||
|
||||
if [[ -n "${KUBE_FIREWALL_METADATA_SERVER:-}" ]]; then
|
||||
if [[ -n "${ENABLE_METADATA_CONCEALMENT:-}" ]]; then
|
||||
iptables -A KUBE-METADATA-SERVER -j DROP
|
||||
fi
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ enable_cluster_ui: '$(echo "$ENABLE_CLUSTER_UI" | sed -e "s/'/''/g")'
|
|||
enable_node_problem_detector: '$(echo "$ENABLE_NODE_PROBLEM_DETECTOR" | sed -e "s/'/''/g")'
|
||||
enable_l7_loadbalancing: '$(echo "$ENABLE_L7_LOADBALANCING" | sed -e "s/'/''/g")'
|
||||
enable_node_logging: '$(echo "$ENABLE_NODE_LOGGING" | sed -e "s/'/''/g")'
|
||||
enable_metadata_proxy: '$(echo "$ENABLE_METADATA_PROXY" | sed -e "s/'/''/g")'
|
||||
enable_metadata_proxy: '$(echo "$ENABLE_METADATA_CONCEALMENT" | sed -e "s/'/''/g")'
|
||||
enable_metrics_server: '$(echo "$ENABLE_METRICS_SERVER" | sed -e "s/'/''/g")'
|
||||
enable_rescheduler: '$(echo "$ENABLE_RESCHEDULER" | sed -e "s/'/''/g")'
|
||||
logging_destination: '$(echo "$LOGGING_DESTINATION" | sed -e "s/'/''/g")'
|
||||
|
|
|
@ -52,7 +52,7 @@ function config-ip-firewall {
|
|||
iptables -N KUBE-METADATA-SERVER
|
||||
iptables -I FORWARD -p tcp -d 169.254.169.254 --dport 80 -j KUBE-METADATA-SERVER
|
||||
|
||||
if [[ -n "${KUBE_FIREWALL_METADATA_SERVER:-}" ]]; then
|
||||
if [[ -n "${ENABLE_METADATA_CONCEALMENT:-}" ]]; then
|
||||
iptables -A KUBE-METADATA-SERVER -j DROP
|
||||
fi
|
||||
}
|
||||
|
@ -1862,7 +1862,7 @@ EOF
|
|||
if [[ "${ENABLE_IP_MASQ_AGENT:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "ip-masq-agent"
|
||||
fi
|
||||
if [[ "${ENABLE_METADATA_PROXY:-}" == "simple" ]]; then
|
||||
if [[ "${ENABLE_METADATA_CONCEALMENT:-}" == "true" ]]; then
|
||||
setup-addon-manifests "addons" "metadata-proxy/gce"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue