mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Use old dns-ip mechanism with older cdk-addons.
This commit is contained in:
parent
23c81bb3d4
commit
d8e3861991
@ -572,6 +572,7 @@ def configure_cdk_addons():
|
||||
dnsEnabled = str(hookenv.config('enable-kube-dns')).lower()
|
||||
args = [
|
||||
'arch=' + arch(),
|
||||
'dns-ip=' + get_deprecated_dns_ip(),
|
||||
'dns-domain=' + hookenv.config('dns_domain'),
|
||||
'enable-dashboard=' + dbEnabled,
|
||||
'enable-kube-dns=' + dnsEnabled
|
||||
@ -964,6 +965,14 @@ def get_dns_ip():
|
||||
return svc['spec']['clusterIP']
|
||||
|
||||
|
||||
def get_deprecated_dns_ip():
|
||||
'''We previously hardcoded the dns ip. This function returns the old
|
||||
hardcoded value for use with older versions of cdk_addons.'''
|
||||
interface = ipaddress.IPv4Interface(service_cidr())
|
||||
ip = interface.network.network_address + 10
|
||||
return ip.exploded
|
||||
|
||||
|
||||
def get_kubernetes_service_ip():
|
||||
'''Get the IP address for the kubernetes service based on the cidr.'''
|
||||
interface = ipaddress.IPv4Interface(service_cidr())
|
||||
|
Loading…
Reference in New Issue
Block a user