kubernator 1.0.8__tar.gz → 1.0.9__tar.gz
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-1.0.8 → kubernator-1.0.9}/PKG-INFO +9 -1
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/__init__.py +1 -1
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/api.py +3 -2
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/helm.py +1 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/istio.py +12 -1
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/kubectl.py +6 -3
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/minikube.py +38 -7
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/terraform.py +1 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/terragrunt.py +2 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/PKG-INFO +9 -1
- kubernator-1.0.9/setup.py +95 -0
- kubernator-1.0.8/setup.py +0 -95
- {kubernator-1.0.8 → kubernator-1.0.9}/MANIFEST.in +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/LICENSE +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/__main__.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/app.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/__init__.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/awscli.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/eks.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/k8s.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/k8s_api.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/kops.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/kubeconfig.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/plugins/template.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator/proc.py +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/SOURCES.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/dependency_links.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/entry_points.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/namespace_packages.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/requires.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/top_level.txt +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/kubernator.egg-info/zip-safe +0 -0
- {kubernator-1.0.8 → kubernator-1.0.9}/setup.cfg +0 -0
|
@@ -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.
|
|
@@ -82,6 +82,14 @@ A simple example is as follows:
|
|
|
82
82
|
$ docker run --mount type=bind,source="$(pwd)",target=/root,readonly -t ghcr.io/karellen/kubernator:latest
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## Using Kubernator on MacOS
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
$ brew install python3.11
|
|
89
|
+
$ pip3.11 install `kubernator~=1.0.9`
|
|
90
|
+
$ kubernator --version
|
|
91
|
+
```
|
|
92
|
+
|
|
85
93
|
Please note, that some plugins (e.g. `awscli`, `eks`) may require additional volume mounts or environmental
|
|
86
94
|
variables to be passed for credentials and other external configuration.
|
|
87
95
|
|
|
@@ -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
|
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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
|
|
@@ -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
|
|
|
@@ -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)
|
|
@@ -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.
|
|
@@ -82,6 +82,14 @@ A simple example is as follows:
|
|
|
82
82
|
$ docker run --mount type=bind,source="$(pwd)",target=/root,readonly -t ghcr.io/karellen/kubernator:latest
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## Using Kubernator on MacOS
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
$ brew install python3.11
|
|
89
|
+
$ pip3.11 install `kubernator~=1.0.9`
|
|
90
|
+
$ kubernator --version
|
|
91
|
+
```
|
|
92
|
+
|
|
85
93
|
Please note, that some plugins (e.g. `awscli`, `eks`) may require additional volume mounts or environmental
|
|
86
94
|
variables to be passed for credentials and other external configuration.
|
|
87
95
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
from setuptools import setup
|
|
5
|
+
from setuptools.command.install import install as _install
|
|
6
|
+
|
|
7
|
+
class install(_install):
|
|
8
|
+
def pre_install_script(self):
|
|
9
|
+
pass
|
|
10
|
+
|
|
11
|
+
def post_install_script(self):
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
def run(self):
|
|
15
|
+
self.pre_install_script()
|
|
16
|
+
|
|
17
|
+
_install.run(self)
|
|
18
|
+
|
|
19
|
+
self.post_install_script()
|
|
20
|
+
|
|
21
|
+
if __name__ == '__main__':
|
|
22
|
+
setup(
|
|
23
|
+
name = 'kubernator',
|
|
24
|
+
version = '1.0.9',
|
|
25
|
+
description = 'Kubernator is the a pluggable framework for K8S provisioning',
|
|
26
|
+
long_description = '# Kubernator\n\nKubernator™ (Ktor™) is an integrated solution for the Kubernetes state management. It operates on directories,\nprocessing their content via a collection of plugins, generating Kubernetes resources in the process, validating them,\ntransforming them and then applying against the Kubernetes cluster.\n\n[](https://gitter.im/karellen/Lobby)\n[](https://github.com/karellen/kubernator/actions/workflows/kubernator.yml)\n[](https://coveralls.io/r/karellen/kubernator?branch=master)\n\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n\n## Notices\n\n### Beta Software\n\nWhile fully functional in the current state and used in production, this software is in **BETA**. A lot of things\nare expected to change rapidly, including main APIs, initialization procedures and some core features. Documentation at\nthis stage is basically non-existent.\n\n### License\n\nThe product is licensed under the Apache License, Version 2.0. Please see LICENSE for further details.\n\n### Warranties and Liability\n\nKubernator and its plugins are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\nexpress or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,\nMERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of\nusing or redistributing Kubernator and assume any risks associated with doing so.\n\n### Trademarks\n\n"Kubernator" and "Ktor" are trademarks or registered trademarks of Express Systems USA, Inc and Karellen, Inc. All other\ntrademarks are property of their respective owners.\n\n## Problem Statement\n\n## Solution\n\n## Using Kubernator with Docker\n\nA simple example is as follows:\n```\n$ docker run --mount type=bind,source="$(pwd)",target=/root,readonly -t ghcr.io/karellen/kubernator:latest\n```\n\n## Using Kubernator on MacOS\n\n```\n$ brew install python3.11\n$ pip3.11 install `kubernator~=1.0.9`\n$ kubernator --version\n```\n\nPlease note, that some plugins (e.g. `awscli`, `eks`) may require additional volume mounts or environmental\nvariables to be passed for credentials and other external configuration.\n\n## Mode of Operation\n\nKubernator is a command line utility. Upon startup and processing of the command line arguments and initializing\nlogging, Kubernator initializes plugins. Current plugins include:\n\n0. Kubernator App\n1. Terraform\n2. kOps\n3. Kubernetes\n4. Helm\n5. Template\n\nThe order of initialization matters as it\'s the order the plugin handlers are executed!\n\nThe entire application operates in the following stages by invoking each plugin\'s stage handler in sequence:\n\n1. Plugin Init Stage\n2. Pre-start script (if specified)\n3. Plugin Start Stage\n4. For each directory in the pipeline:\n 1. Plugin Before Directory Stage\n 2. If `.kubernator.py` is present in the directory:\n 1. Plugin Before Script Stage\n 2. `.kubernator.py` script\n 3. Plugin After Script Stage\n 3. Plugin After Directory Stage\n5. Plugin End Stage\n\nEach plugin individually plays a specific role and performs a specific function which will be described in a later\nsection.\n\n## State/Context\n\nThere is a global state that is carried through as the application is running. It is a hierarchy of objects (`context`)\nthat follows the parent-child relationship as the application traverses the directory structure. For example, given the\ndirectory structure `/a/b`, `/a/c`, and `/a/c/d` any value of the context set or modified in context scoped to\ndirectory `/a` is visible in directories `/a/b`, `/a/c` and `/a/c/d`, while the same modified or set in `/a/b` is only\nvisible there, while one in `/a/c` is visible in `/a/c` and in `/a/c/d` but not `/a` or `/a/b`.\n\nAdditionally, there is a `context.globals` which is the top-most context that is available in all stages that are not\nassociated with the directory structure.\n\nNote, that in cases where the directory structure traversal moves to remote directories (that are actualized by local\ntemporary directories), such remote directory structure enters the context hierarchy as a child of the directory in\nwhich remote was registered.\n\nAlso note, that context carries not just data by references to essential functions.\n\nIn pre-start and `.kubernator.py` scripts the context is fully available as a global variable `ktor`.\n\n### Plugins\n\n#### Kubernator App Plugin\n\nThe role of the Kubernator App Plugin is to traverse the directory structure, expose essential functions through context\nand to run Kubernator scripts.\n\nIn the *After Directory Stage* Kubernator app scans the directories immediately available in the current, sorts them in\nthe alphabetic order, excludes those matching any of the patterns in `context.app.excludes` and then queues up the\nremaining directories in the order the match the patterns in `context.app.includes`.\n\nThus, for a directory content `/a/foo`, `/a/bal`, `/a/bar`, `/a/baz`, excludes `f*`, and includes `baz` and `*`, the\nresulting queue of directories to traverse will be `/a/baz`, `/a/bal`, `/a/bar`.\n\nNotice, that user can further interfere with processing order of the directory queue by asking Kubernator to walk\narbitrary paths, both local and remote.\n\n##### Context\n\n* `ktor.app.args`\n > Namespace containing command line argument values\n* `ktor.app.walk_local(*paths: Union[Path, str, bytes])`\n > Immediately schedules the paths to be traversed after the current directory by adding them to the queue\n > Relative path is relative to the current directory\n* `ktor.app.walk_remote(repo, *path_prefixes: Union[Path, str, bytes])`\n > Immediately schedules the path prefixes under the remote repo URL to be traversed after the current directory by\n > adding them to the queue. Only Git URLs are currently supported.\n > All absolute path prefixes are relativized based on the repository.\n* `ktor.app.repository_credentials_provider(func: Callable)`\n > Sets a repository credentials provider function `func` that sets/overwrites credentials for URLs being specified by\n > `walk_remote`. The callable `func` accepts a single argument containing a parsed URL in a form of tuple. The `func`\n > is expected to return a tuple of three elements representing URL schema, username and password. If the value should\n > not be changed it should be None. To convert from `git://repo.com/hello` to HTTPS authentication one should write\n > a function returning `("https", "username", "password")`. The best utility is achieved by logic that allows running\n > the plan both in CI and local environments using different authentication mechanics in different environments.\n\n#### Terraform\n\nThis is exclusively designed to pull the configuration options out of Terraform and to allow scripts and plugins to\nutilize that data.\n\n##### Context\n\n* `ktor.tf`\n > A dictionary containing the values from Terraform output\n\n#### Kops\n\n##### Context\n\n#### Kubernetes\n\n##### Context\n\n#### Helm\n\n##### Context\n\n#### Templates\n\n##### Context\n\n## Examples\n\n### Adding Remote Directory\n\n```python\nktor.app.repository_credentials_provider(lambda r: ("ssh", "git", None))\nktor.app.walk_remote("git://repo.example.com/org/project?ref=dev", "/project")\n```\n\n### Adding Local Directory\n\n```python\nktor.app.walk_local("/home/username/local-dir")\n```\n\n### Using Transformers\n\n```python\ndef remove_replicas(resources, r: "K8SResource"):\n if (r.group == "apps" and r.kind in ("StatefulSet", "Deployment")\n and "replicas" in r.manifest["spec"]):\n logger.warning("Resource %s in %s contains `replica` specification that will be removed. Use HPA!!!",\n r, r.source)\n del r.manifest["spec"]["replicas"]\n\n\nktor.k8s.add_transformer(remove_replicas)\n```\n',
|
|
27
|
+
long_description_content_type = 'text/markdown',
|
|
28
|
+
classifiers = [
|
|
29
|
+
'License :: OSI Approved :: Apache Software License',
|
|
30
|
+
'Programming Language :: Python :: 3.9',
|
|
31
|
+
'Programming Language :: Python :: 3.10',
|
|
32
|
+
'Programming Language :: Python :: 3.11',
|
|
33
|
+
'Operating System :: MacOS :: MacOS X',
|
|
34
|
+
'Operating System :: POSIX',
|
|
35
|
+
'Operating System :: POSIX :: Linux',
|
|
36
|
+
'Environment :: Console',
|
|
37
|
+
'Topic :: Utilities',
|
|
38
|
+
'Topic :: System :: Monitoring',
|
|
39
|
+
'Topic :: System :: Distributed Computing',
|
|
40
|
+
'Topic :: System :: Clustering',
|
|
41
|
+
'Topic :: System :: Networking',
|
|
42
|
+
'Intended Audience :: System Administrators',
|
|
43
|
+
'Intended Audience :: Developers',
|
|
44
|
+
'Development Status :: 4 - Beta'
|
|
45
|
+
],
|
|
46
|
+
keywords = 'kubernetes k8s kube top provisioning kOps terraform tf AWS',
|
|
47
|
+
|
|
48
|
+
author = 'Express Systems USA, Inc.',
|
|
49
|
+
author_email = '',
|
|
50
|
+
maintainer = 'Karellen, Inc., Arcadiy Ivanov',
|
|
51
|
+
maintainer_email = 'supervisor@karellen.co,arcadiy@karellen.co',
|
|
52
|
+
|
|
53
|
+
license = 'Apache License, Version 2.0',
|
|
54
|
+
|
|
55
|
+
url = 'https://github.com/karellen/kubernator',
|
|
56
|
+
project_urls = {
|
|
57
|
+
'Bug Tracker': 'https://github.com/karellen/kubernator/issues',
|
|
58
|
+
'Documentation': 'https://github.com/karellen/kubernator/',
|
|
59
|
+
'Source Code': 'https://github.com/karellen/kubernator/'
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
scripts = [],
|
|
63
|
+
packages = [
|
|
64
|
+
'kubernator',
|
|
65
|
+
'kubernator.plugins'
|
|
66
|
+
],
|
|
67
|
+
namespace_packages = [],
|
|
68
|
+
py_modules = [],
|
|
69
|
+
entry_points = {
|
|
70
|
+
'console_scripts': ['kubernator = kubernator:main']
|
|
71
|
+
},
|
|
72
|
+
data_files = [],
|
|
73
|
+
package_data = {
|
|
74
|
+
'kubernator': ['LICENSE']
|
|
75
|
+
},
|
|
76
|
+
install_requires = [
|
|
77
|
+
'appdirs~=1.4',
|
|
78
|
+
'coloredlogs~=15.0',
|
|
79
|
+
'gevent>=21.1.2',
|
|
80
|
+
'jinja2~=3.1',
|
|
81
|
+
'json-log-formatter~=0.3',
|
|
82
|
+
'jsonpatch~=1.32',
|
|
83
|
+
'jsonpath-ng~=1.5',
|
|
84
|
+
'jsonschema<4.0',
|
|
85
|
+
'kubernetes~=28.0',
|
|
86
|
+
'openapi-schema-validator~=0.1',
|
|
87
|
+
'openapi-spec-validator~=0.3',
|
|
88
|
+
'requests~=2.25'
|
|
89
|
+
],
|
|
90
|
+
dependency_links = [],
|
|
91
|
+
zip_safe = True,
|
|
92
|
+
cmdclass = {'install': install},
|
|
93
|
+
python_requires = '>=3.9',
|
|
94
|
+
obsoletes = [],
|
|
95
|
+
)
|
kubernator-1.0.8/setup.py
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
from setuptools import setup
|
|
5
|
-
from setuptools.command.install import install as _install
|
|
6
|
-
|
|
7
|
-
class install(_install):
|
|
8
|
-
def pre_install_script(self):
|
|
9
|
-
pass
|
|
10
|
-
|
|
11
|
-
def post_install_script(self):
|
|
12
|
-
pass
|
|
13
|
-
|
|
14
|
-
def run(self):
|
|
15
|
-
self.pre_install_script()
|
|
16
|
-
|
|
17
|
-
_install.run(self)
|
|
18
|
-
|
|
19
|
-
self.post_install_script()
|
|
20
|
-
|
|
21
|
-
if __name__ == '__main__':
|
|
22
|
-
setup(
|
|
23
|
-
name = 'kubernator',
|
|
24
|
-
version = '1.0.8',
|
|
25
|
-
description = 'Kubernator is the a pluggable framework for K8S provisioning',
|
|
26
|
-
long_description = '# Kubernator\n\nKubernator™ (Ktor™) is an integrated solution for the Kubernetes state management. It operates on directories,\nprocessing their content via a collection of plugins, generating Kubernetes resources in the process, validating them,\ntransforming them and then applying against the Kubernetes cluster.\n\n[](https://gitter.im/karellen/Lobby)\n[](https://github.com/karellen/kubernator/actions/workflows/kubernator.yml)\n[](https://coveralls.io/r/karellen/kubernator?branch=master)\n\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n[](https://pypi.org/project/kubernator/)\n\n## Notices\n\n### Beta Software\n\nWhile fully functional in the current state and used in production, this software is in **BETA**. A lot of things\nare expected to change rapidly, including main APIs, initialization procedures and some core features. Documentation at\nthis stage is basically non-existent.\n\n### License\n\nThe product is licensed under the Apache License, Version 2.0. Please see LICENSE for further details.\n\n### Warranties and Liability\n\nKubernator and its plugins are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\nexpress or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,\nMERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of\nusing or redistributing Kubernator and assume any risks associated with doing so.\n\n### Trademarks\n\n"Kubernator" and "Ktor" are trademarks or registered trademarks of Express Systems USA, Inc and Karellen, Inc. All other\ntrademarks are property of their respective owners.\n\n## Problem Statement\n\n## Solution\n\n## Using Kubernator with Docker\n\nA simple example is as follows:\n```\n$ docker run --mount type=bind,source="$(pwd)",target=/root,readonly -t ghcr.io/karellen/kubernator:latest\n```\n\nPlease note, that some plugins (e.g. `awscli`, `eks`) may require additional volume mounts or environmental\nvariables to be passed for credentials and other external configuration.\n\n## Mode of Operation\n\nKubernator is a command line utility. Upon startup and processing of the command line arguments and initializing\nlogging, Kubernator initializes plugins. Current plugins include:\n\n0. Kubernator App\n1. Terraform\n2. kOps\n3. Kubernetes\n4. Helm\n5. Template\n\nThe order of initialization matters as it\'s the order the plugin handlers are executed!\n\nThe entire application operates in the following stages by invoking each plugin\'s stage handler in sequence:\n\n1. Plugin Init Stage\n2. Pre-start script (if specified)\n3. Plugin Start Stage\n4. For each directory in the pipeline:\n 1. Plugin Before Directory Stage\n 2. If `.kubernator.py` is present in the directory:\n 1. Plugin Before Script Stage\n 2. `.kubernator.py` script\n 3. Plugin After Script Stage\n 3. Plugin After Directory Stage\n5. Plugin End Stage\n\nEach plugin individually plays a specific role and performs a specific function which will be described in a later\nsection.\n\n## State/Context\n\nThere is a global state that is carried through as the application is running. It is a hierarchy of objects (`context`)\nthat follows the parent-child relationship as the application traverses the directory structure. For example, given the\ndirectory structure `/a/b`, `/a/c`, and `/a/c/d` any value of the context set or modified in context scoped to\ndirectory `/a` is visible in directories `/a/b`, `/a/c` and `/a/c/d`, while the same modified or set in `/a/b` is only\nvisible there, while one in `/a/c` is visible in `/a/c` and in `/a/c/d` but not `/a` or `/a/b`.\n\nAdditionally, there is a `context.globals` which is the top-most context that is available in all stages that are not\nassociated with the directory structure.\n\nNote, that in cases where the directory structure traversal moves to remote directories (that are actualized by local\ntemporary directories), such remote directory structure enters the context hierarchy as a child of the directory in\nwhich remote was registered.\n\nAlso note, that context carries not just data by references to essential functions.\n\nIn pre-start and `.kubernator.py` scripts the context is fully available as a global variable `ktor`.\n\n### Plugins\n\n#### Kubernator App Plugin\n\nThe role of the Kubernator App Plugin is to traverse the directory structure, expose essential functions through context\nand to run Kubernator scripts.\n\nIn the *After Directory Stage* Kubernator app scans the directories immediately available in the current, sorts them in\nthe alphabetic order, excludes those matching any of the patterns in `context.app.excludes` and then queues up the\nremaining directories in the order the match the patterns in `context.app.includes`.\n\nThus, for a directory content `/a/foo`, `/a/bal`, `/a/bar`, `/a/baz`, excludes `f*`, and includes `baz` and `*`, the\nresulting queue of directories to traverse will be `/a/baz`, `/a/bal`, `/a/bar`.\n\nNotice, that user can further interfere with processing order of the directory queue by asking Kubernator to walk\narbitrary paths, both local and remote.\n\n##### Context\n\n* `ktor.app.args`\n > Namespace containing command line argument values\n* `ktor.app.walk_local(*paths: Union[Path, str, bytes])`\n > Immediately schedules the paths to be traversed after the current directory by adding them to the queue\n > Relative path is relative to the current directory\n* `ktor.app.walk_remote(repo, *path_prefixes: Union[Path, str, bytes])`\n > Immediately schedules the path prefixes under the remote repo URL to be traversed after the current directory by\n > adding them to the queue. Only Git URLs are currently supported.\n > All absolute path prefixes are relativized based on the repository.\n* `ktor.app.repository_credentials_provider(func: Callable)`\n > Sets a repository credentials provider function `func` that sets/overwrites credentials for URLs being specified by\n > `walk_remote`. The callable `func` accepts a single argument containing a parsed URL in a form of tuple. The `func`\n > is expected to return a tuple of three elements representing URL schema, username and password. If the value should\n > not be changed it should be None. To convert from `git://repo.com/hello` to HTTPS authentication one should write\n > a function returning `("https", "username", "password")`. The best utility is achieved by logic that allows running\n > the plan both in CI and local environments using different authentication mechanics in different environments.\n\n#### Terraform\n\nThis is exclusively designed to pull the configuration options out of Terraform and to allow scripts and plugins to\nutilize that data.\n\n##### Context\n\n* `ktor.tf`\n > A dictionary containing the values from Terraform output\n\n#### Kops\n\n##### Context\n\n#### Kubernetes\n\n##### Context\n\n#### Helm\n\n##### Context\n\n#### Templates\n\n##### Context\n\n## Examples\n\n### Adding Remote Directory\n\n```python\nktor.app.repository_credentials_provider(lambda r: ("ssh", "git", None))\nktor.app.walk_remote("git://repo.example.com/org/project?ref=dev", "/project")\n```\n\n### Adding Local Directory\n\n```python\nktor.app.walk_local("/home/username/local-dir")\n```\n\n### Using Transformers\n\n```python\ndef remove_replicas(resources, r: "K8SResource"):\n if (r.group == "apps" and r.kind in ("StatefulSet", "Deployment")\n and "replicas" in r.manifest["spec"]):\n logger.warning("Resource %s in %s contains `replica` specification that will be removed. Use HPA!!!",\n r, r.source)\n del r.manifest["spec"]["replicas"]\n\n\nktor.k8s.add_transformer(remove_replicas)\n```\n',
|
|
27
|
-
long_description_content_type = 'text/markdown',
|
|
28
|
-
classifiers = [
|
|
29
|
-
'License :: OSI Approved :: Apache Software License',
|
|
30
|
-
'Programming Language :: Python :: 3.9',
|
|
31
|
-
'Programming Language :: Python :: 3.10',
|
|
32
|
-
'Programming Language :: Python :: 3.11',
|
|
33
|
-
'Operating System :: MacOS :: MacOS X',
|
|
34
|
-
'Operating System :: POSIX',
|
|
35
|
-
'Operating System :: POSIX :: Linux',
|
|
36
|
-
'Environment :: Console',
|
|
37
|
-
'Topic :: Utilities',
|
|
38
|
-
'Topic :: System :: Monitoring',
|
|
39
|
-
'Topic :: System :: Distributed Computing',
|
|
40
|
-
'Topic :: System :: Clustering',
|
|
41
|
-
'Topic :: System :: Networking',
|
|
42
|
-
'Intended Audience :: System Administrators',
|
|
43
|
-
'Intended Audience :: Developers',
|
|
44
|
-
'Development Status :: 4 - Beta'
|
|
45
|
-
],
|
|
46
|
-
keywords = 'kubernetes k8s kube top provisioning kOps terraform tf AWS',
|
|
47
|
-
|
|
48
|
-
author = 'Express Systems USA, Inc.',
|
|
49
|
-
author_email = '',
|
|
50
|
-
maintainer = 'Karellen, Inc., Arcadiy Ivanov',
|
|
51
|
-
maintainer_email = 'supervisor@karellen.co,arcadiy@karellen.co',
|
|
52
|
-
|
|
53
|
-
license = 'Apache License, Version 2.0',
|
|
54
|
-
|
|
55
|
-
url = 'https://github.com/karellen/kubernator',
|
|
56
|
-
project_urls = {
|
|
57
|
-
'Bug Tracker': 'https://github.com/karellen/kubernator/issues',
|
|
58
|
-
'Documentation': 'https://github.com/karellen/kubernator/',
|
|
59
|
-
'Source Code': 'https://github.com/karellen/kubernator/'
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
scripts = [],
|
|
63
|
-
packages = [
|
|
64
|
-
'kubernator',
|
|
65
|
-
'kubernator.plugins'
|
|
66
|
-
],
|
|
67
|
-
namespace_packages = [],
|
|
68
|
-
py_modules = [],
|
|
69
|
-
entry_points = {
|
|
70
|
-
'console_scripts': ['kubernator = kubernator:main']
|
|
71
|
-
},
|
|
72
|
-
data_files = [],
|
|
73
|
-
package_data = {
|
|
74
|
-
'kubernator': ['LICENSE']
|
|
75
|
-
},
|
|
76
|
-
install_requires = [
|
|
77
|
-
'appdirs~=1.4',
|
|
78
|
-
'coloredlogs~=15.0',
|
|
79
|
-
'gevent>=21.1.2',
|
|
80
|
-
'jinja2~=3.1',
|
|
81
|
-
'json-log-formatter~=0.3',
|
|
82
|
-
'jsonpatch~=1.32',
|
|
83
|
-
'jsonpath-ng~=1.5',
|
|
84
|
-
'jsonschema<4.0',
|
|
85
|
-
'kubernetes~=28.0',
|
|
86
|
-
'openapi-schema-validator~=0.1',
|
|
87
|
-
'openapi-spec-validator~=0.3',
|
|
88
|
-
'requests~=2.25'
|
|
89
|
-
],
|
|
90
|
-
dependency_links = [],
|
|
91
|
-
zip_safe = True,
|
|
92
|
-
cmdclass = {'install': install},
|
|
93
|
-
python_requires = '>=3.9',
|
|
94
|
-
obsoletes = [],
|
|
95
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|