Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: each apiserver process listens on its own IP address
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Mar 26, 2020
1 parent 6dadaf0 commit e992d0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion parts/k8s/cloud-init/masternodecustomdata.yml
Expand Up @@ -402,6 +402,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER
content: |
#!/bin/bash
set -e
PRIVATE_IP=$(hostname -i | cut -d" " -f1)
{{if IsMasterVirtualMachineScaleSets}}
PRIVATE_IP=$(hostname -i | cut -d" " -f1)
sed -i "s|<SERVERIP>|https://$PRIVATE_IP:443|g" "/var/lib/kubelet/kubeconfig"
Expand All @@ -410,7 +411,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER
# Redirect ILB (4443) traffic to port 443 (ELB) in the prerouting chain
iptables -t nat -A PREROUTING -p tcp --dport 4443 -j REDIRECT --to-port 443
{{end}}
sed -i "s|<advertiseAddr>|{{WrapAsVariable "kubernetesAPIServerIP"}}|g" /etc/kubernetes/manifests/kube-apiserver.yaml
sed -i "s|<advertiseAddr>|$PRIVATE_IP|g" /etc/kubernetes/manifests/kube-apiserver.yaml

{{if EnableDataEncryptionAtRest }}
sed -i "s|<etcdEncryptionSecret>|\"{{WrapAsParameter "etcdEncryptionKey"}}\"|g" /etc/kubernetes/encryption-config.yaml
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e992d0f

Please sign in to comment.