nyl 0.3.0__tar.gz → 0.4.0__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.
- {nyl-0.3.0 → nyl-0.4.0}/PKG-INFO +1 -1
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration/profiles.md +21 -4
- {nyl-0.3.0 → nyl-0.4.0}/pyproject.toml +1 -1
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/profiles/config.py +14 -1
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/profiles/kubeconfig.py +11 -2
- {nyl-0.3.0 → nyl-0.4.0}/.envrc +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/.github/workflows/docker.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/.github/workflows/docs.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/.github/workflows/python.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/.gitignore +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/.kraken.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/README.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-cmp/Dockerfile +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-cmp/README.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-cmp/plugin.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/.envrc +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/.secrets.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/.sops.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/README.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/argocd.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/nyl-project.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/argocd-with-nyl/nyl-secrets.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/index.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/applysets.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/argocd-plugin.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/cluster-connectivity.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration/environment.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration/projects.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration/secrets.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration-api/profiles.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/configuration-api/secrets.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/glossary.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/basics.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/components.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/inlining/helmcharts.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/inlining/overview.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/inlining/postprocessor.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/content/reference/templating/secrets.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/mkdocs.yml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/pyproject.toml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/docs/uv.lock +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/example/manifests/postgres.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/example/nyl-profiles.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/example/nyl-secrets.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/example/secrets.yaml +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/README.md +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/__init__.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/dynamic/__init__.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/dynamic/client.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/dynamic/discovery.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/dynamic/exceptions.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/dynamic/resource.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/watch/__init__.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/kubernetes/watch/watch.pyi +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/argocd.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/crds.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/new.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/profile.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/run.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/secrets.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/template.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/tools/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/tools/bcrypt.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/tools/sops.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/commands/tun.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/components.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/dispatch.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/dispatch_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/helmchart.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/generator/statefulsecret.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/profiles/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/profiles/config_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/profiles/tunnel.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/project/config.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/applyset.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/applyset_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/helmchart.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/placeholder.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/postprocessor.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/postprocessor_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/resources/statefulsecret.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/config.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/config_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/null.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/sops.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/secrets/sops_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/templating.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/templating_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/fs.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/fs_test.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/kubectl.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/kubernetes.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/kvstore.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/loads.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/logging.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/shell.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/testing.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/typer.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/types.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/src/nyl/tools/yaml.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/tests/__init__.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/tests/conftest.py +0 -0
- {nyl-0.3.0 → nyl-0.4.0}/uv.lock +0 -0
{nyl-0.3.0 → nyl-0.4.0}/PKG-INFO
RENAMED
|
@@ -45,9 +45,12 @@ machine and use that to connect to the Kubernetes cluster.
|
|
|
45
45
|
```toml title="nyl-profile.toml"
|
|
46
46
|
[default.kubeconfig]
|
|
47
47
|
type = "ssh"
|
|
48
|
+
sudo = false # default, set to true to use `sudo cat <path>`
|
|
48
49
|
user = "root"
|
|
49
50
|
host = "mycluster.example.com"
|
|
51
|
+
port = 22 # default
|
|
50
52
|
path = "/etc/rancher/k3s/k3s.yaml"
|
|
53
|
+
# replace_apiserver_hostname
|
|
51
54
|
|
|
52
55
|
[default.tunnel]
|
|
53
56
|
type = "ssh"
|
|
@@ -61,9 +64,12 @@ machine and use that to connect to the Kubernetes cluster.
|
|
|
61
64
|
default:
|
|
62
65
|
kubeconfig:
|
|
63
66
|
type: ssh
|
|
67
|
+
sudo: false
|
|
64
68
|
user: root
|
|
65
69
|
host: mycluster.example.com
|
|
70
|
+
port: 22
|
|
66
71
|
path: /etc/rancher/k3s/k3s.yaml
|
|
72
|
+
replace_apiserver_hostname: null
|
|
67
73
|
tunnel:
|
|
68
74
|
type: ssh
|
|
69
75
|
user: root
|
|
@@ -77,9 +83,12 @@ machine and use that to connect to the Kubernetes cluster.
|
|
|
77
83
|
"default": {
|
|
78
84
|
"kubeconfig": {
|
|
79
85
|
"type": "ssh",
|
|
86
|
+
"sudo": false,
|
|
80
87
|
"user": "root",
|
|
81
88
|
"host": "mycluster.example.com",
|
|
82
|
-
"
|
|
89
|
+
"port": 22,
|
|
90
|
+
"path": "/etc/rancher/k3s/k3s.yaml",
|
|
91
|
+
"replace_apiserver_hostname": null
|
|
83
92
|
},
|
|
84
93
|
"tunnel": {
|
|
85
94
|
"type": "ssh",
|
|
@@ -100,7 +109,7 @@ is reachable from your local machine.
|
|
|
100
109
|
user = "root"
|
|
101
110
|
host = "mycluster.example.com"
|
|
102
111
|
path = "/etc/rancher/k3s/k3s.yaml"
|
|
103
|
-
replace_apiserver_hostname = "
|
|
112
|
+
replace_apiserver_hostname = "reachable-address.com"
|
|
104
113
|
```
|
|
105
114
|
|
|
106
115
|
=== "YAML"
|
|
@@ -112,7 +121,7 @@ is reachable from your local machine.
|
|
|
112
121
|
user: root
|
|
113
122
|
host: mycluster.example.com
|
|
114
123
|
path: /etc/rancher/k3s/k3s.yaml
|
|
115
|
-
replace_apiserver_hostname:
|
|
124
|
+
replace_apiserver_hostname: reachable-address.com
|
|
116
125
|
```
|
|
117
126
|
|
|
118
127
|
=== "JSON"
|
|
@@ -125,11 +134,19 @@ is reachable from your local machine.
|
|
|
125
134
|
"user": "root",
|
|
126
135
|
"host": "mycluster.example.com",
|
|
127
136
|
"path": "/etc/rancher/k3s/k3s.yaml",
|
|
128
|
-
"replace_apiserver_hostname": "
|
|
137
|
+
"replace_apiserver_hostname": "reachable-address.com"
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
```
|
|
132
141
|
|
|
142
|
+
!!! note
|
|
143
|
+
|
|
144
|
+
When retrieving a Kubeconfig via SSH that has `127.0.0.1`, `0.0.0.0` or `localhost` as the hostname in the `server`
|
|
145
|
+
field, and `replace_apiserver_hostname` is not specified, Nyl will automatically replace it with the `host` field
|
|
146
|
+
specified that was used to execute the remote command to read the Kubeconfig. This is because we expect the two
|
|
147
|
+
hosts to be the same, and you cannot reach the Kubernetes API server through your local machine without using tunnel
|
|
148
|
+
(which you can use, see [Tunnel management](#tunnel-management)).
|
|
149
|
+
|
|
133
150
|
If you are you are already setup with a kubeconfig file, you can specify the path to the file directly or have it
|
|
134
151
|
automatically use your `~/.kube/config` file/`KUBECONFIG` environment variable. You may specify the context to use
|
|
135
152
|
from that kubeconfig file which ensures Nyl interacts with the correct cluster, even if your
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nyl"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0" # sed'ed on publish in CI
|
|
8
8
|
description = "Advanced templating engine for Kubernetes and GitOps."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Niklas Rosenstein", email = "rosensteinniklas@gmail.com"},
|
|
@@ -58,11 +58,21 @@ class KubeconfigFromSsh:
|
|
|
58
58
|
The username to connect to the remote host with.
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
|
+
sudo: bool = False
|
|
62
|
+
"""
|
|
63
|
+
Use `sudo cat` to retrieve the file instead of ust `cat`.
|
|
64
|
+
"""
|
|
65
|
+
|
|
61
66
|
host: str
|
|
62
67
|
"""
|
|
63
68
|
The remote host to connect to.
|
|
64
69
|
"""
|
|
65
70
|
|
|
71
|
+
port: int = 22
|
|
72
|
+
"""
|
|
73
|
+
SSH port to use.
|
|
74
|
+
"""
|
|
75
|
+
|
|
66
76
|
identity_file: str | None = None
|
|
67
77
|
"""
|
|
68
78
|
An SSH private key file to use for authentication.
|
|
@@ -82,7 +92,10 @@ class KubeconfigFromSsh:
|
|
|
82
92
|
"""
|
|
83
93
|
Replace the hostname in the apiserver configuration of the Kubeconfig. This is useful for example with K3s when
|
|
84
94
|
reading reading the `/etc/rancher/k3s/k3s.yaml` file from a remote host, but the API server in that file is not
|
|
85
|
-
reachable from
|
|
95
|
+
reachable from that machine.
|
|
96
|
+
|
|
97
|
+
Note that if the host in the retrieve Kubeconfig is `localhost`, `0.0.0.0` or `127.0.0.1`, it will be automatically
|
|
98
|
+
replaced with the specified `host` that was also SSH-ed to, unless this option is set.
|
|
86
99
|
"""
|
|
87
100
|
|
|
88
101
|
|
|
@@ -67,9 +67,13 @@ class KubeconfigManager:
|
|
|
67
67
|
|
|
68
68
|
command = [
|
|
69
69
|
"ssh",
|
|
70
|
+
"-p",
|
|
71
|
+
str(source.port),
|
|
70
72
|
f"{source.user}@{source.host}",
|
|
71
73
|
f"cat {shlex.quote(source.path)}",
|
|
72
74
|
]
|
|
75
|
+
if source.sudo:
|
|
76
|
+
command[4] = "sudo " + command[4]
|
|
73
77
|
if source.identity_file:
|
|
74
78
|
command[1:1] = ["-i", str(self._cwd / source.identity_file)]
|
|
75
79
|
|
|
@@ -94,8 +98,13 @@ class KubeconfigManager:
|
|
|
94
98
|
if api_host is None:
|
|
95
99
|
raise ValueError(f"no hostname in Kubeconfig server URL: {server!r}")
|
|
96
100
|
|
|
97
|
-
if isinstance(source, KubeconfigFromSsh)
|
|
98
|
-
|
|
101
|
+
if isinstance(source, KubeconfigFromSsh):
|
|
102
|
+
if source.replace_apiserver_hostname:
|
|
103
|
+
api_host = source.replace_apiserver_hostname
|
|
104
|
+
elif api_host in ("127.0.0.1", "0.0.0.0", "localhost"):
|
|
105
|
+
# Automatically replace the API server since we won't be able to reach the Kubernetes API server
|
|
106
|
+
# pointing to localhost from the current machine.
|
|
107
|
+
api_host = source.host
|
|
99
108
|
|
|
100
109
|
raw_kubeconfig.chmod(0o600)
|
|
101
110
|
return GetRawKubeconfigResult(
|
{nyl-0.3.0 → nyl-0.4.0}/.envrc
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
{nyl-0.3.0 → nyl-0.4.0}/uv.lock
RENAMED
|
File without changes
|