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

Use external cloud provider for EKS Local deployments #1111

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions files/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,13 @@ if [[ "${ENABLE_LOCAL_OUTPOST}" == "true" ]]; then
mv /var/lib/kubelet/kubeconfig /var/lib/kubelet/bootstrap-kubeconfig
KUBELET_EXTRA_ARGS="--bootstrap-kubeconfig /var/lib/kubelet/bootstrap-kubeconfig $KUBELET_EXTRA_ARGS"
fi
### For Local Outpost deployments, we will use the the external cloud provider
KUBELET_CLOUD_PROVIDER="external"
else
sed -i s,CLUSTER_NAME,$CLUSTER_NAME,g /var/lib/kubelet/kubeconfig

### For any other type of deployment we will use the aws cloud provider for backwards compatibility
KUBELET_CLOUD_PROVIDER="aws"
fi

### kubelet.service configuration
Expand Down Expand Up @@ -462,6 +467,11 @@ cat << EOF > /etc/systemd/system/kubelet.service.d/10-kubelet-args.conf
Environment='KUBELET_ARGS=--node-ip=$INTERNAL_IP --pod-infra-container-image=$PAUSE_CONTAINER --v=2'
EOF

cat << EOF > /etc/systemd/system/kubelet.service.d/20-kubelet-cloud-provider.conf
[Service]
Environment='KUBELET_CLOUD_PROVIDER=$KUBELET_CLOUD_PROVIDER'
EOF

if [[ -n "$KUBELET_EXTRA_ARGS" ]]; then
cat << EOF > /etc/systemd/system/kubelet.service.d/30-kubelet-extra-args.conf
[Service]
Expand Down
2 changes: 1 addition & 1 deletion files/kubelet-containerd.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Requires=containerd.service sandbox-image.service

[Service]
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT -w 5
ExecStart=/usr/bin/kubelet --cloud-provider aws \
ExecStart=/usr/bin/kubelet --cloud-provider $KUBELET_CLOUD_PROVIDER \
--config /etc/kubernetes/kubelet/kubelet-config.json \
--kubeconfig /var/lib/kubelet/kubeconfig \
--container-runtime remote \
Expand Down
2 changes: 1 addition & 1 deletion files/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Requires=docker.service

[Service]
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT -w 5
ExecStart=/usr/bin/kubelet --cloud-provider aws \
ExecStart=/usr/bin/kubelet --cloud-provider $KUBELET_CLOUD_PROVIDER \
--config /etc/kubernetes/kubelet/kubelet-config.json \
--kubeconfig /var/lib/kubelet/kubeconfig \
--container-runtime docker \
Expand Down