kubernator 1.0.8__py3-none-any.whl → 1.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kubernator might be problematic. Click here for more details.
- kubernator/__init__.py +1 -1
- kubernator/api.py +3 -2
- kubernator/plugins/helm.py +1 -0
- kubernator/plugins/istio.py +12 -1
- kubernator/plugins/kubectl.py +6 -3
- kubernator/plugins/minikube.py +38 -7
- kubernator/plugins/terraform.py +1 -0
- kubernator/plugins/terragrunt.py +2 -0
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/METADATA +9 -1
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/RECORD +15 -15
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/WHEEL +0 -0
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/entry_points.txt +0 -0
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/namespace_packages.txt +0 -0
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/top_level.txt +0 -0
- {kubernator-1.0.8.dist-info → kubernator-1.0.9.dist-info}/zip-safe +0 -0
kubernator/__init__.py
CHANGED
kubernator/api.py
CHANGED
|
@@ -235,8 +235,9 @@ def install_python_k8s_client(run, package_major, logger_stdout, logger_stderr):
|
|
|
235
235
|
if not package_major_dir.exists():
|
|
236
236
|
package_major_dir.mkdir(parents=True, exist_ok=True)
|
|
237
237
|
|
|
238
|
-
run(["pip", "install", "--no-deps", "--no-cache-dir", "--no-input", "--
|
|
239
|
-
|
|
238
|
+
run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-cache-dir", "--no-input", "--pre",
|
|
239
|
+
"--root-user-action=ignore", "--break-system-packages", "--disable-pip-version-check",
|
|
240
|
+
"--target", str(package_major_dir), f"kubernetes~={package_major}.0"], logger_stdout, logger_stderr).wait()
|
|
240
241
|
|
|
241
242
|
return package_major_dir
|
|
242
243
|
|
kubernator/plugins/helm.py
CHANGED
|
@@ -124,6 +124,7 @@ class HelmPlugin(KubernatorPlugin):
|
|
|
124
124
|
helm_file_dl, _ = context.app.download_remote_file(logger, helm_url, "bin")
|
|
125
125
|
helm_file_dl = str(helm_file_dl)
|
|
126
126
|
self.helm_dir = tempfile.TemporaryDirectory()
|
|
127
|
+
context.app.register_cleanup(self.helm_dir)
|
|
127
128
|
|
|
128
129
|
helm_file = str(Path(self.helm_dir.name) / "helm")
|
|
129
130
|
helm_tar = tarfile.open(helm_file_dl)
|
kubernator/plugins/istio.py
CHANGED
|
@@ -66,11 +66,22 @@ class IstioPlugin(KubernatorPlugin, K8SResourcePluginMixin):
|
|
|
66
66
|
|
|
67
67
|
if version:
|
|
68
68
|
# Download and use specific version
|
|
69
|
+
istioctl_os = get_golang_os()
|
|
70
|
+
if istioctl_os == "darwin":
|
|
71
|
+
istioctl_os = "osx"
|
|
72
|
+
istioctl_machine = get_golang_machine()
|
|
73
|
+
if istioctl_machine == "amd64":
|
|
74
|
+
istioctl_platform = istioctl_os
|
|
75
|
+
else:
|
|
76
|
+
istioctl_platform = f"{istioctl_os}-{istioctl_machine}"
|
|
77
|
+
else:
|
|
78
|
+
istioctl_platform = f"{istioctl_os}-{get_golang_machine()}"
|
|
69
79
|
istioctl_url = (f"https://github.com/istio/istio/releases/download/{version}/"
|
|
70
|
-
f"istioctl-{version}-{
|
|
80
|
+
f"istioctl-{version}-{istioctl_platform}.tar.gz")
|
|
71
81
|
istioctl_file_dl, _ = context.app.download_remote_file(logger, istioctl_url, "bin")
|
|
72
82
|
istioctl_file_dl = str(istioctl_file_dl)
|
|
73
83
|
self.istioctl_dir = tempfile.TemporaryDirectory()
|
|
84
|
+
context.app.register_cleanup(self.istioctl_dir)
|
|
74
85
|
|
|
75
86
|
istioctl_file = str(Path(self.istioctl_dir.name) / "istioctl")
|
|
76
87
|
istio_tar = tarfile.open(istioctl_file_dl)
|
kubernator/plugins/kubectl.py
CHANGED
|
@@ -51,15 +51,18 @@ class KubectlPlugin(KubernatorPlugin):
|
|
|
51
51
|
|
|
52
52
|
def stanza(self):
|
|
53
53
|
context = self.context.kubectl
|
|
54
|
-
return [context.kubectl_file, f"--kubeconfig={context.kubeconfig}"]
|
|
54
|
+
return [context.kubectl_file, f"--kubeconfig={self.context.kubeconfig.kubeconfig}"]
|
|
55
55
|
|
|
56
56
|
def register(self,
|
|
57
57
|
version=None,
|
|
58
58
|
kubeconfig=None):
|
|
59
59
|
context = self.context
|
|
60
60
|
|
|
61
|
+
context.app.register_plugin("kubeconfig")
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
if not version and "k8s" in context:
|
|
64
|
+
version = ".".join(context.k8s.server_version)
|
|
65
|
+
logger.info("Kubernetes plugin is running with server version %s - will use it", version)
|
|
63
66
|
|
|
64
67
|
if version:
|
|
65
68
|
# Download and use specific version
|
|
@@ -69,6 +72,7 @@ class KubectlPlugin(KubernatorPlugin):
|
|
|
69
72
|
kubectl_file_dl, _ = context.app.download_remote_file(logger, kubectl_url, "bin")
|
|
70
73
|
kubectl_file_dl = str(kubectl_file_dl)
|
|
71
74
|
self.kubectl_dir = tempfile.TemporaryDirectory()
|
|
75
|
+
context.app.register_cleanup(self.kubectl_dir)
|
|
72
76
|
|
|
73
77
|
kubectl_file = str(Path(self.kubectl_dir.name) / "kubectl")
|
|
74
78
|
copy(kubectl_file_dl, kubectl_file)
|
|
@@ -83,7 +87,6 @@ class KubectlPlugin(KubernatorPlugin):
|
|
|
83
87
|
logger.debug("Found kubectl in %r", kubectl_file)
|
|
84
88
|
|
|
85
89
|
context.globals.kubectl = dict(version=version,
|
|
86
|
-
kubeconfig=kubeconfig,
|
|
87
90
|
kubectl_file=kubectl_file,
|
|
88
91
|
stanza=self.stanza,
|
|
89
92
|
test=self.test_kubectl
|
kubernator/plugins/minikube.py
CHANGED
|
@@ -89,7 +89,7 @@ class MinikubePlugin(KubernatorPlugin):
|
|
|
89
89
|
|
|
90
90
|
def register(self, minikube_version=None, profile="default", k8s_version=None,
|
|
91
91
|
keep_running=False, start_fresh=False,
|
|
92
|
-
nodes=1, driver=
|
|
92
|
+
nodes=1, driver=None, cpus="no-limit", extra_args=None):
|
|
93
93
|
context = self.context
|
|
94
94
|
|
|
95
95
|
context.app.register_plugin("kubeconfig")
|
|
@@ -111,6 +111,8 @@ class MinikubePlugin(KubernatorPlugin):
|
|
|
111
111
|
|
|
112
112
|
os.chmod(minikube_dl_file, 0o500)
|
|
113
113
|
self.minikube_dir = tempfile.TemporaryDirectory()
|
|
114
|
+
context.app.register_cleanup(self.minikube_dir)
|
|
115
|
+
|
|
114
116
|
minikube_file = Path(self.minikube_dir.name) / "minikube"
|
|
115
117
|
minikube_file.symlink_to(minikube_dl_file)
|
|
116
118
|
prepend_os_path(self.minikube_dir.name)
|
|
@@ -125,6 +127,31 @@ class MinikubePlugin(KubernatorPlugin):
|
|
|
125
127
|
self.kubeconfig_dir = profile_dir / ".kube"
|
|
126
128
|
self.kubeconfig_dir.mkdir(parents=True, exist_ok=True)
|
|
127
129
|
|
|
130
|
+
if not driver:
|
|
131
|
+
driver = "docker"
|
|
132
|
+
if get_golang_os() == "darwin":
|
|
133
|
+
logger.debug("Auto-detecting Minikube driver on MacOS...")
|
|
134
|
+
cmd_debug_logger = StripNL(proc_logger.debug)
|
|
135
|
+
try:
|
|
136
|
+
context.app.run(["docker", "info"], cmd_debug_logger, cmd_debug_logger).wait()
|
|
137
|
+
logger.info("Docker is functional, selecting 'docker' as the driver for Minikube")
|
|
138
|
+
except (FileNotFoundError, CalledProcessError) as e:
|
|
139
|
+
logger.trace("Docker is NOT functional", exc_info=e)
|
|
140
|
+
driver = "hyperkit"
|
|
141
|
+
try:
|
|
142
|
+
context.app.run(["hyperkit", "-v"], cmd_debug_logger, cmd_debug_logger).wait()
|
|
143
|
+
logger.info("Hyperkit is functional, selecting 'hyperkit' as the driver for Minikube")
|
|
144
|
+
except (FileNotFoundError, CalledProcessError) as e:
|
|
145
|
+
logger.trace("Hyperkit is NOT functional", exc_info=e)
|
|
146
|
+
driver = "podman"
|
|
147
|
+
try:
|
|
148
|
+
context.app.run(["podman", "info"], cmd_debug_logger, cmd_debug_logger).wait()
|
|
149
|
+
logger.info("Podman is functional, selecting 'podman' as the driver for Minikube")
|
|
150
|
+
except (FileNotFoundError, CalledProcessError) as e:
|
|
151
|
+
logger.trace("Podman is NOT functional", exc_info=e)
|
|
152
|
+
raise RuntimeError("No Minikube driver is functional on MacOS. "
|
|
153
|
+
"Tried 'docker', 'hyperkit' and 'podman'!")
|
|
154
|
+
|
|
128
155
|
context.globals.minikube = dict(version=version,
|
|
129
156
|
minikube_file=str(minikube_file),
|
|
130
157
|
profile=profile,
|
|
@@ -159,12 +186,16 @@ class MinikubePlugin(KubernatorPlugin):
|
|
|
159
186
|
minikube = self.context.minikube
|
|
160
187
|
if not self.minikube_is_running():
|
|
161
188
|
logger.info("Starting minikube profile %r...", minikube.profile)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
189
|
+
args = ["start",
|
|
190
|
+
"--driver", str(minikube.driver),
|
|
191
|
+
"--kubernetes-version", str(minikube.k8s_version),
|
|
192
|
+
"--wait", "apiserver",
|
|
193
|
+
"--nodes", str(minikube.nodes)]
|
|
194
|
+
|
|
195
|
+
if minikube.driver == "docker":
|
|
196
|
+
args.extend(["--cpus", str(minikube.cpus)])
|
|
197
|
+
|
|
198
|
+
self.cmd(*args)
|
|
168
199
|
else:
|
|
169
200
|
logger.warning("Minikube profile %r is already running!", minikube.profile)
|
|
170
201
|
|
kubernator/plugins/terraform.py
CHANGED
|
@@ -65,6 +65,7 @@ class TerraformPlugin(KubernatorPlugin):
|
|
|
65
65
|
tf_file_dl, _ = context.app.download_remote_file(logger, tf_url, "bin")
|
|
66
66
|
tf_file_dl = str(tf_file_dl)
|
|
67
67
|
self.tf_dir = tempfile.TemporaryDirectory()
|
|
68
|
+
context.app.register_cleanup(self.tf_dir)
|
|
68
69
|
|
|
69
70
|
tf_file = str(Path(self.tf_dir.name) / "terraform")
|
|
70
71
|
tf_zip = zipfile.ZipFile(tf_file_dl)
|
kubernator/plugins/terragrunt.py
CHANGED
|
@@ -63,6 +63,8 @@ class TerragruntPlugin(KubernatorPlugin):
|
|
|
63
63
|
tg_file_cache, _ = context.app.download_remote_file(logger, tg_url, "bin")
|
|
64
64
|
|
|
65
65
|
self.tg_dir = tempfile.TemporaryDirectory()
|
|
66
|
+
context.app.register_cleanup(self.tg_dir)
|
|
67
|
+
|
|
66
68
|
tg_file = Path(self.tg_dir.name) / "terragrunt"
|
|
67
69
|
copy(tg_file_cache, tg_file)
|
|
68
70
|
os.chmod(tg_file, 0o500)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kubernator
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.9
|
|
4
4
|
Summary: Kubernator is the a pluggable framework for K8S provisioning
|
|
5
5
|
Home-page: https://github.com/karellen/kubernator
|
|
6
6
|
Author: Express Systems USA, Inc.
|
|
@@ -94,6 +94,14 @@ A simple example is as follows:
|
|
|
94
94
|
$ docker run --mount type=bind,source="$(pwd)",target=/root,readonly -t ghcr.io/karellen/kubernator:latest
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
## Using Kubernator on MacOS
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
$ brew install python3.11
|
|
101
|
+
$ pip3.11 install `kubernator~=1.0.9`
|
|
102
|
+
$ kubernator --version
|
|
103
|
+
```
|
|
104
|
+
|
|
97
105
|
Please note, that some plugins (e.g. `awscli`, `eks`) may require additional volume mounts or environmental
|
|
98
106
|
variables to be passed for credentials and other external configuration.
|
|
99
107
|
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
kubernator/LICENSE,sha256=wKKdOCMTCPQRV5gDkVLAsXX8qSnRJ5owk7yWPO1KZNo,11387
|
|
2
|
-
kubernator/__init__.py,sha256=
|
|
2
|
+
kubernator/__init__.py,sha256=rcD5CPBpOGbNhfl_wPGOSLE09R46hfwZvoI5LoGDzzQ,914
|
|
3
3
|
kubernator/__main__.py,sha256=f0S60wgpLu--1UlOhzfWail-xt8zyIuODodX98_yPN0,707
|
|
4
|
-
kubernator/api.py,sha256=
|
|
4
|
+
kubernator/api.py,sha256=3hxYHOJt_ps9VFqqOuIHOHPLThLb98RO-gZZ_E-xd9I,24951
|
|
5
5
|
kubernator/app.py,sha256=kGS8jVcf-nCY1mP6MdqMR27XNcEMb5Uxek9FEW4GWLg,19472
|
|
6
6
|
kubernator/proc.py,sha256=8YlgbppyHic_51fVTPD7OP8x5yuRuL8j1kThR8MJjNI,5119
|
|
7
7
|
kubernator/plugins/__init__.py,sha256=h9TLYK8UFEi53ipZSZsTBjp0ljKhisWsgPpt_PkWrO8,670
|
|
8
8
|
kubernator/plugins/awscli.py,sha256=S6X7-qFiaZ7NDVDl2Jg0t-ih9KAJ45cUjjzd5Qe93ZM,4252
|
|
9
9
|
kubernator/plugins/eks.py,sha256=xe7vyPHNwuP8gEYDSzPyBkm-RkAtP64wCOqs9U5I7xI,2273
|
|
10
|
-
kubernator/plugins/helm.py,sha256=
|
|
11
|
-
kubernator/plugins/istio.py,sha256=
|
|
10
|
+
kubernator/plugins/helm.py,sha256=3BYZBPoiMUtNgmhdcbYCVRTPtaQMYzhfnMqXWyZRJZc,10525
|
|
11
|
+
kubernator/plugins/istio.py,sha256=rjqFyWWKVhcv8tB5sY9cAQV8XnmUYc5vn8t1R6GRjOQ,10432
|
|
12
12
|
kubernator/plugins/k8s.py,sha256=klbAU-DIDNzY-aXfbhxQKHwGhStTmJ-k7ydr1ckUqr8,20248
|
|
13
13
|
kubernator/plugins/k8s_api.py,sha256=xsDQii32khCUOc4hMlNc0zHLQK73VTb4kdnug8ukmy4,26000
|
|
14
14
|
kubernator/plugins/kops.py,sha256=QsrQJUF6wGJo2QRVqP92pG5vmOTYQIc25PD_DWCzrAA,9635
|
|
15
15
|
kubernator/plugins/kubeconfig.py,sha256=uwtHmF2I6LiTPrC3M88G5SfYxDWtuh0MqcMfrHHoNRA,2178
|
|
16
|
-
kubernator/plugins/kubectl.py,sha256=
|
|
17
|
-
kubernator/plugins/minikube.py,sha256=
|
|
16
|
+
kubernator/plugins/kubectl.py,sha256=IgNghW1Q6s8V2o08eNY2NWfkkdV9Z6X2A3YFQinFr4g,4028
|
|
17
|
+
kubernator/plugins/minikube.py,sha256=_ArOg4IPIEhYoQJUjzHyGYFSDjyL-FmTS4v5RXLgQSs,10147
|
|
18
18
|
kubernator/plugins/template.py,sha256=o6UqLw1wK91gCfN7q-Wwc3P5iycAeELUryXh-egA2vQ,8070
|
|
19
|
-
kubernator/plugins/terraform.py,sha256=
|
|
20
|
-
kubernator/plugins/terragrunt.py,sha256
|
|
21
|
-
kubernator-1.0.
|
|
22
|
-
kubernator-1.0.
|
|
23
|
-
kubernator-1.0.
|
|
24
|
-
kubernator-1.0.
|
|
25
|
-
kubernator-1.0.
|
|
26
|
-
kubernator-1.0.
|
|
27
|
-
kubernator-1.0.
|
|
19
|
+
kubernator/plugins/terraform.py,sha256=a1MPl9G8Rznjd28uMRdYWrjpFDLlFAVmLFH4hFEsMsQ,5285
|
|
20
|
+
kubernator/plugins/terragrunt.py,sha256=-qN8tTqPUXJ9O7CEiJVUB0GSUQU3DUTkv-aWdIIsm7Q,5051
|
|
21
|
+
kubernator-1.0.9.dist-info/METADATA,sha256=VTK-bcgPiBMRbVo1HPsxd7Ygj_zOnJfXzUcg2kvhvUg,10426
|
|
22
|
+
kubernator-1.0.9.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
23
|
+
kubernator-1.0.9.dist-info/entry_points.txt,sha256=IWDtHzyTleRqDSuVRXEr5GImrI7z_kh21t5DWZ8ldcQ,47
|
|
24
|
+
kubernator-1.0.9.dist-info/namespace_packages.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
25
|
+
kubernator-1.0.9.dist-info/top_level.txt,sha256=_z1CxWeKMI55ckf2vC8HqjbCn_E2Y_P5RdrhE_QWcIs,11
|
|
26
|
+
kubernator-1.0.9.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
27
|
+
kubernator-1.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|