[feat] Add tiller-host and -port options to apply
This allows the use of a standalone tiller service.
This commit is contained in:
parent
d187c839ab
commit
721b6de6bf
|
@ -25,6 +25,8 @@ def applyCharts(args):
|
||||||
args.dry_run,
|
args.dry_run,
|
||||||
args.wait,
|
args.wait,
|
||||||
args.timeout,
|
args.timeout,
|
||||||
|
args.tiller_host,
|
||||||
|
args.tiller_port,
|
||||||
args.debug_logging)
|
args.debug_logging)
|
||||||
armada.sync()
|
armada.sync()
|
||||||
|
|
||||||
|
@ -49,6 +51,10 @@ class ApplyChartsCommand(cmd.Command):
|
||||||
parser.add_argument('--timeout', action='store', type=int,
|
parser.add_argument('--timeout', action='store', type=int,
|
||||||
default=3600, help='Specifies time to wait'
|
default=3600, help='Specifies time to wait'
|
||||||
' for charts to deploy')
|
' for charts to deploy')
|
||||||
|
parser.add_argument('--tiller-host', action='store', type=str,
|
||||||
|
help='Specify the tiller host')
|
||||||
|
parser.add_argument('--tiller-port', action='store', type=int,
|
||||||
|
default=44134, help='Specify the tiller port')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
|
|
@ -46,6 +46,8 @@ class Armada(object):
|
||||||
dry_run=False,
|
dry_run=False,
|
||||||
wait=False,
|
wait=False,
|
||||||
timeout=DEFAULT_TIMEOUT,
|
timeout=DEFAULT_TIMEOUT,
|
||||||
|
tiller_host=None,
|
||||||
|
tiller_port=44134,
|
||||||
debug=False):
|
debug=False):
|
||||||
'''
|
'''
|
||||||
Initialize the Armada Engine and establish
|
Initialize the Armada Engine and establish
|
||||||
|
@ -58,7 +60,7 @@ class Armada(object):
|
||||||
self.wait = wait
|
self.wait = wait
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
self.config = yaml.load(config)
|
self.config = yaml.load(config)
|
||||||
self.tiller = Tiller()
|
self.tiller = Tiller(tiller_host=tiller_host, tiller_port=tiller_port)
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
|
|
||||||
# Set debug value
|
# Set debug value
|
||||||
|
|
|
@ -49,8 +49,10 @@ class Tiller(object):
|
||||||
service over gRPC
|
service over gRPC
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, tiller_host=None, tiller_port=TILLER_PORT):
|
||||||
|
|
||||||
|
self.tiller_host = tiller_host
|
||||||
|
self.tiller_port = tiller_port
|
||||||
# init k8s connectivity
|
# init k8s connectivity
|
||||||
self.k8s = K8s()
|
self.k8s = K8s()
|
||||||
|
|
||||||
|
@ -74,9 +76,8 @@ class Tiller(object):
|
||||||
Return a tiller channel
|
Return a tiller channel
|
||||||
'''
|
'''
|
||||||
tiller_ip = self._get_tiller_ip()
|
tiller_ip = self._get_tiller_ip()
|
||||||
tiller_port = self._get_tiller_port()
|
|
||||||
return grpc.insecure_channel(
|
return grpc.insecure_channel(
|
||||||
'%s:%s' % (tiller_ip, tiller_port),
|
'%s:%s' % (tiller_ip, self.tiller_port),
|
||||||
options=[
|
options=[
|
||||||
('grpc.max_send_message_length', MAX_MESSAGE_LENGTH),
|
('grpc.max_send_message_length', MAX_MESSAGE_LENGTH),
|
||||||
('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)
|
('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)
|
||||||
|
@ -96,8 +97,11 @@ class Tiller(object):
|
||||||
'''
|
'''
|
||||||
Returns the tiller pod's IP address by searching all namespaces
|
Returns the tiller pod's IP address by searching all namespaces
|
||||||
'''
|
'''
|
||||||
pod = self._get_tiller_pod()
|
if self.tiller_host:
|
||||||
return pod.status.pod_ip
|
return self.tiller_host
|
||||||
|
else:
|
||||||
|
pod = self._get_tiller_pod()
|
||||||
|
return pod.status.pod_ip
|
||||||
|
|
||||||
def _get_tiller_port(self):
|
def _get_tiller_port(self):
|
||||||
'''Stub method to support arbitrary ports in the future'''
|
'''Stub method to support arbitrary ports in the future'''
|
||||||
|
|
Loading…
Reference in New Issue