mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-09-30 20:46:32 +00:00
added delete-pod
This commit is contained in:
@@ -55,7 +55,7 @@ logs:
|
||||
kubectl logs geth-$(net)-044 -f
|
||||
|
||||
ssh:
|
||||
kubectl exec -it geth-$(net)-044 -- /bin/bash
|
||||
kubectl exec -it geth-$(net)-046 -- /bin/bash
|
||||
|
||||
attach:
|
||||
kubectl exec -it geth-$(net)-01 -- $(geth) attach
|
||||
|
||||
@@ -75,6 +75,12 @@ class Bootnode(object):
|
||||
# self.kube.create_pool(network)
|
||||
self.kube.create_pod(config)
|
||||
|
||||
def delete_pod(self, network, name):
|
||||
network, id = Ethereum.normalize_network(network)
|
||||
config = Ethereum(name, network)
|
||||
|
||||
self.kube.delete_pod(name, config)
|
||||
|
||||
def list_pods(self, network=None):
|
||||
table(self.kube.list_pods(network=network), 'name', 'phase', 'block_number', 'ip')
|
||||
|
||||
|
||||
@@ -86,6 +86,9 @@ class Kubernetes(object):
|
||||
def create_pod(self, config):
|
||||
return self.api.create_namespaced_pod(POD_NAMESPACE, body=config)
|
||||
|
||||
def delete_pod(self, name, config):
|
||||
return self.api.delete_namespaced_pod(name, POD_NAMESPACE, body=config)
|
||||
|
||||
def list_pods(self, network=None):
|
||||
pods = [Pod(p, self) for p in
|
||||
self.api.list_namespaced_pod(POD_NAMESPACE).items]
|
||||
|
||||
@@ -70,6 +70,11 @@ def parser():
|
||||
create_pod.add_argument('name', help='Name of pod')
|
||||
create_pod.set_defaults(command='create_pod')
|
||||
|
||||
delete_pod = subparsers.add_parser('delete-pod', help='Delete pod')
|
||||
delete_pod.add_argument('network', help='Name of network to use')
|
||||
delete_pod.add_argument('name', help='Name of pod')
|
||||
delete_pod.set_defaults(command='delete_pod')
|
||||
|
||||
list_pods = subparsers.add_parser('pods', help='List pods')
|
||||
list_pods.set_defaults(command='list_pods')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user