mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Merge pull request #27278 from activars/aws_optional_dhcp_set_id
Automatic merge from submit-queue Making DHCP_OPTION_SET_ID creation optional Reason: We have a pre-configured VPC in AWS. `kube-up.sh` should not making changes to the VPC DHCP option if there's already DHCP options configured. PR Changes: When `DHCP_OPTION_SET_ID` is given in environment variable, kube-up.sh will skip the `DHCP_OPTION_SET_ID` creation.
This commit is contained in:
commit
c0e0e74728
@ -535,22 +535,24 @@ function ensure-master-ip {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Creates a new DHCP option set configured correctly for Kubernetes
|
# Creates a new DHCP option set configured correctly for Kubernetes when DHCP_OPTION_SET_ID is not specified
|
||||||
# Sets DHCP_OPTION_SET_ID
|
# Sets DHCP_OPTION_SET_ID
|
||||||
function create-dhcp-option-set () {
|
function create-dhcp-option-set () {
|
||||||
case "${AWS_REGION}" in
|
if [[ -z ${DHCP_OPTION_SET_ID-} ]]; then
|
||||||
us-east-1)
|
case "${AWS_REGION}" in
|
||||||
OPTION_SET_DOMAIN=ec2.internal
|
us-east-1)
|
||||||
;;
|
OPTION_SET_DOMAIN=ec2.internal
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
OPTION_SET_DOMAIN="${AWS_REGION}.compute.internal"
|
OPTION_SET_DOMAIN="${AWS_REGION}.compute.internal"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
DHCP_OPTION_SET_ID=$($AWS_CMD create-dhcp-options --dhcp-configuration Key=domain-name,Values=${OPTION_SET_DOMAIN} Key=domain-name-servers,Values=AmazonProvidedDNS --query DhcpOptions.DhcpOptionsId)
|
DHCP_OPTION_SET_ID=$($AWS_CMD create-dhcp-options --dhcp-configuration Key=domain-name,Values=${OPTION_SET_DOMAIN} Key=domain-name-servers,Values=AmazonProvidedDNS --query DhcpOptions.DhcpOptionsId)
|
||||||
|
|
||||||
add-tag ${DHCP_OPTION_SET_ID} Name kubernetes-dhcp-option-set
|
add-tag ${DHCP_OPTION_SET_ID} Name kubernetes-dhcp-option-set
|
||||||
add-tag ${DHCP_OPTION_SET_ID} KubernetesCluster ${CLUSTER_ID}
|
add-tag ${DHCP_OPTION_SET_ID} KubernetesCluster ${CLUSTER_ID}
|
||||||
|
fi
|
||||||
|
|
||||||
$AWS_CMD associate-dhcp-options --dhcp-options-id ${DHCP_OPTION_SET_ID} --vpc-id ${VPC_ID} > $LOG
|
$AWS_CMD associate-dhcp-options --dhcp-options-id ${DHCP_OPTION_SET_ID} --vpc-id ${VPC_ID} > $LOG
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user