kubed-krm 0.0.1__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.
Files changed (83) hide show
  1. kubed_krm-0.0.1/.devcontainer.json +62 -0
  2. kubed_krm-0.0.1/.dockerignore +14 -0
  3. kubed_krm-0.0.1/.editorconfig +3 -0
  4. kubed_krm-0.0.1/.envrc +1 -0
  5. kubed_krm-0.0.1/.github/workflows/publish.yml +57 -0
  6. kubed_krm-0.0.1/.gitignore +29 -0
  7. kubed_krm-0.0.1/.python-version +1 -0
  8. kubed_krm-0.0.1/.vscode/extensions.json +6 -0
  9. kubed_krm-0.0.1/.vscode/launch.json +18 -0
  10. kubed_krm-0.0.1/CHANGELOG.md +11 -0
  11. kubed_krm-0.0.1/CONTRIBUTING.md +135 -0
  12. kubed_krm-0.0.1/Dockerfile +61 -0
  13. kubed_krm-0.0.1/LICENSE +21 -0
  14. kubed_krm-0.0.1/Makefile +31 -0
  15. kubed_krm-0.0.1/PKG-INFO +39 -0
  16. kubed_krm-0.0.1/README.md +4 -0
  17. kubed_krm-0.0.1/build.sh +13 -0
  18. kubed_krm-0.0.1/docker-compose.yaml +30 -0
  19. kubed_krm-0.0.1/docs/conf.py +99 -0
  20. kubed_krm-0.0.1/docs/generators/lastpass.md +3 -0
  21. kubed_krm-0.0.1/docs/index.md +35 -0
  22. kubed_krm-0.0.1/docs/metadata.md.jinja +4 -0
  23. kubed_krm-0.0.1/docs/modules/cubizoid.md +23 -0
  24. kubed_krm-0.0.1/docs/modules/files.md +23 -0
  25. kubed_krm-0.0.1/docs/requirements.txt +10 -0
  26. kubed_krm-0.0.1/docs/schema.json +41 -0
  27. kubed_krm-0.0.1/docs/transformers/embed.md +26 -0
  28. kubed_krm-0.0.1/docs/transformers/replicate.md +45 -0
  29. kubed_krm-0.0.1/docs/tutorials/extend_kube_tools.md +22 -0
  30. kubed_krm-0.0.1/examples/api.py +83 -0
  31. kubed_krm-0.0.1/examples/embed/container.json +14 -0
  32. kubed_krm-0.0.1/examples/embed/embed.yaml +61 -0
  33. kubed_krm-0.0.1/examples/embed/kustomization.yaml +6 -0
  34. kubed_krm-0.0.1/examples/embed/pod.yaml +8 -0
  35. kubed_krm-0.0.1/examples/embed/some.sh +1 -0
  36. kubed_krm-0.0.1/examples/embed/some.yaml +12 -0
  37. kubed_krm-0.0.1/examples/envmapper/set-env.yaml +20 -0
  38. kubed_krm-0.0.1/examples/kompose/docker-compose.yml +26 -0
  39. kubed_krm-0.0.1/examples/kompose/kompose.yaml +19 -0
  40. kubed_krm-0.0.1/examples/kompose/kustomization.yaml +5 -0
  41. kubed_krm-0.0.1/examples/krm/kustomization.yaml +4 -0
  42. kubed_krm-0.0.1/examples/krm/test-krm.py +23 -0
  43. kubed_krm-0.0.1/examples/krm/test-krm.yaml +10 -0
  44. kubed_krm-0.0.1/examples/lastpass/example.yaml +39 -0
  45. kubed_krm-0.0.1/examples/lastpass/kustomization.yaml +4 -0
  46. kubed_krm-0.0.1/examples/listify/kustomization.yaml +13 -0
  47. kubed_krm-0.0.1/examples/listify/listify.yaml +12 -0
  48. kubed_krm-0.0.1/examples/listify/some-list.yaml +79 -0
  49. kubed_krm-0.0.1/examples/replicate/README.md +3 -0
  50. kubed_krm-0.0.1/examples/replicate/conf.yaml +8 -0
  51. kubed_krm-0.0.1/examples/replicate/generated.yaml +33 -0
  52. kubed_krm-0.0.1/examples/replicate/kustomization.yaml +24 -0
  53. kubed_krm-0.0.1/examples/replicate/multiply.yaml +38 -0
  54. kubed_krm-0.0.1/examples/replicate/some-app.yaml +52 -0
  55. kubed_krm-0.0.1/kubed/__init__.py +0 -0
  56. kubed_krm-0.0.1/kubed/konfig/__init__.py +0 -0
  57. kubed_krm-0.0.1/kubed/konfig/lastpass.yaml +74 -0
  58. kubed_krm-0.0.1/kubed/krm/__init__.py +0 -0
  59. kubed_krm-0.0.1/kubed/krm/cli.py +38 -0
  60. kubed_krm-0.0.1/kubed/krm/common.py +301 -0
  61. kubed_krm-0.0.1/kubed/krm/common_test.py +30 -0
  62. kubed_krm-0.0.1/kubed/krm/errors.py +5 -0
  63. kubed_krm-0.0.1/kubed/krm/files.py +110 -0
  64. kubed_krm-0.0.1/kubed/krm/k8s.py +10 -0
  65. kubed_krm-0.0.1/kubed/krm/model.py +39 -0
  66. kubed_krm-0.0.1/kubed/krm/util.py +21 -0
  67. kubed_krm-0.0.1/kubed/kubectl/__init__.py +0 -0
  68. kubed_krm-0.0.1/kubed/kubectl/envmap.py +92 -0
  69. kubed_krm-0.0.1/kubed/kubectl/envmap_test.py +4 -0
  70. kubed_krm-0.0.1/kubed/kustomize/__init__.py +0 -0
  71. kubed_krm-0.0.1/kubed/kustomize/embed.py +57 -0
  72. kubed_krm-0.0.1/kubed/kustomize/filter/__init__.py +6 -0
  73. kubed_krm-0.0.1/kubed/kustomize/lastpass.py +83 -0
  74. kubed_krm-0.0.1/kubed/kustomize/replicate.py +98 -0
  75. kubed_krm-0.0.1/kubed/kustomize/replicate_test.py +50 -0
  76. kubed_krm-0.0.1/kubed_krm.egg-info/PKG-INFO +39 -0
  77. kubed_krm-0.0.1/kubed_krm.egg-info/SOURCES.txt +81 -0
  78. kubed_krm-0.0.1/kubed_krm.egg-info/dependency_links.txt +1 -0
  79. kubed_krm-0.0.1/kubed_krm.egg-info/entry_points.txt +9 -0
  80. kubed_krm-0.0.1/kubed_krm.egg-info/requires.txt +18 -0
  81. kubed_krm-0.0.1/kubed_krm.egg-info/top_level.txt +5 -0
  82. kubed_krm-0.0.1/pyproject.toml +110 -0
  83. kubed_krm-0.0.1/setup.cfg +4 -0
@@ -0,0 +1,62 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
3
+ {
4
+ "name": "Kubed KRM Dev",
5
+
6
+ // Update the 'dockerComposeFile' list if you have more compose files or use different names.
7
+ // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
8
+ // "service": "kubed-dev",
9
+ // "runServices": [],
10
+ // "dockerComposeFile": [
11
+ // "docker-compose.yaml"
12
+ // ],
13
+
14
+ "build": {
15
+ "dockerfile": "Dockerfile",
16
+ "target": "dev"
17
+ },
18
+ // The optional 'workspaceFolder' property is the path VS Code should open by default when
19
+ // connected. This is typically a file mount in .devcontainer/docker-compose.yml
20
+ "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
21
+
22
+ // Features to add to the dev container. More info: https://containers.dev/features.
23
+ "features": {
24
+ "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
25
+ "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {}
26
+ },
27
+
28
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
29
+ // "forwardPorts": [],
30
+
31
+ // Uncomment the next line if you want to keep your containers running after VS Code shuts down.
32
+ // "shutdownAction": "none",
33
+
34
+ // Uncomment the next line to run commands after the container is created.
35
+ // "postCreateCommand": "echo hello",
36
+
37
+ "postStartCommand": "echo 'eval \"$(direnv hook bash)\"' >> ~/.bashrc",
38
+
39
+ // Configure tool-specific properties.
40
+ "customizations": {
41
+ "vscode": {
42
+ "extensions": [
43
+ "ms-python.python",
44
+ "ms-python.vscode-pylance",
45
+ "ms-python.debugpy",
46
+ "redhat.vscode-yaml",
47
+ "charliermarsh.ruff",
48
+ "ms-kubernetes-tools.vscode-kubernetes-tools",
49
+ "mads-hartmann.bash-ide-vscode",
50
+ "github.copilot",
51
+ "tamasfe.even-better-toml",
52
+ "github.vscode-github-actions"
53
+ ],
54
+ "settings": {
55
+ "python.defaultInterpreterPath": "/workspaces/krm-py/.direnv/python-3.12.11/bin/python"
56
+ }
57
+ }
58
+ }
59
+
60
+ // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
61
+ // "remoteUser": "devcontainer"
62
+ }
@@ -0,0 +1,14 @@
1
+ .vscode
2
+ build
3
+ dist
4
+ examples
5
+ helm
6
+ lpass
7
+ .editorconfig
8
+ .gitignore
9
+ !.git
10
+ .gitmodules
11
+ docker-compose.yaml
12
+ Dockerfile
13
+ ecr.yaml
14
+ .DS_STORE
@@ -0,0 +1,3 @@
1
+ [*]
2
+ indent_style = space
3
+ indent_size = 2
kubed_krm-0.0.1/.envrc ADDED
@@ -0,0 +1 @@
1
+ layout python3
@@ -0,0 +1,57 @@
1
+ name: 📦 Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch: {}
8
+
9
+ permissions:
10
+ id-token: write
11
+
12
+ jobs:
13
+ package:
14
+ name: Publish PyPI Package
15
+ runs-on: ubuntu-latest
16
+ environment:
17
+ name: pypi
18
+ url: https://pypi.org/project/kubed-krm
19
+ outputs:
20
+ version: ${{ steps.check_version.outputs.version }}
21
+ steps:
22
+
23
+ - name: Checkout Code
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ cache: pip
30
+
31
+ - name: Install Dependencies
32
+ run: pip install '.[build]'
33
+
34
+ - name: Check True Version
35
+ id: check_version
36
+ run: |
37
+ version=$(python -m setuptools_scm)
38
+ package="kubed_krm-${version}"
39
+ echo "Building Version: $version"
40
+ echo "version=$version" >> $GITHUB_OUTPUT
41
+ echo "package=$package" >> $GITHUB_OUTPUT
42
+
43
+ - name: Run the Build
44
+ run: python -m build
45
+
46
+ - name: Show Files
47
+ run: ls -l dist
48
+
49
+ - name: Github Artifact
50
+ uses: actions/upload-artifact@v4
51
+ with:
52
+ name: ${{ steps.check_version.outputs.package }}
53
+ path: dist/*.tar.gz
54
+
55
+ - name: Publish Package to PyPI
56
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
57
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ .secrets
2
+ .project
3
+ .coverage
4
+ secretkey
5
+ credentials.json
6
+ /logs
7
+ /helm
8
+ /rclone
9
+ /apps/**/charts
10
+ /charts/**/charts
11
+ /examples/**/charts
12
+ *.identifier
13
+ *.pyc
14
+ __pycache__
15
+ .DS_Store
16
+ *.egg-info
17
+ .pytest_cache
18
+ /dist
19
+ /build
20
+ /configstore
21
+ .vscode/settings.json
22
+ nvm
23
+ *.log
24
+ _build
25
+ bin
26
+ mume
27
+ /kustomize/plugin/kubed.io
28
+ /packer
29
+ .direnv
@@ -0,0 +1 @@
1
+ 3.12.11
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "tamasfe.even-better-toml",
4
+ "github.vscode-github-actions"
5
+ ]
6
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "configurations": [
3
+ {
4
+ "name": "Kubed KRM",
5
+ "type": "debugpy",
6
+ "request": "launch",
7
+ "program": "src/krm/common.py",
8
+ "console": "integratedTerminal",
9
+ "consoleName": "KRM Debugger",
10
+ "justMyCode": true,
11
+ "args": [
12
+
13
+ ],
14
+ "cwd": "${workspaceFolder}",
15
+ "env": {}
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ - skeleton of the project
11
+ - working build
@@ -0,0 +1,135 @@
1
+ # Contributing
2
+
3
+ Follow these steps to be proper. There is a lot of very specific steps and automations, please read this entire document before starting. Many questions will be answered by simply getting everything setup exactly the same way in the instructions.
4
+
5
+ ## Clone the Repo
6
+
7
+ Clone the repo with the wiki submodule. The wiki submodule contains the static content and templates for mkdocs.
8
+
9
+ ```sh
10
+ git clone --recurse-submodules git@github.com:kubed-io/krm-py.git
11
+ ```
12
+
13
+ ## [Direnv](https://github.com/direnv/direnv) Setup
14
+
15
+ Here is a good start for a decent `.envrc` file.
16
+
17
+ ```sh
18
+ layout python3 # creates the python venv using direnv and sets the VIRTUAL_ENV environment variable to use it
19
+ ```
20
+
21
+ ## Installation
22
+
23
+ Install dependencies in editable mode so you can use step through debugging. All of the optional dependencies are included within the square brackets. You can see what they all are in the [`pyproject.toml`](pyproject.toml) file.
24
+
25
+ ```sh
26
+ pip install --editable '.[build]'
27
+ ```
28
+
29
+ The unit tests are a good starting place for development.
30
+
31
+ ```sh
32
+ pytest src -m unit
33
+ ```
34
+
35
+ At least this should work:
36
+
37
+ ```sh
38
+ kustomize build ./examples/embed --enable-alpha-plugins --enable-exec
39
+ ```
40
+
41
+
42
+ ## Changelog
43
+
44
+ Make sure to take note of your changes in the changelog. This is done by updating the `CHANGELOG.md` file. Add any new details under the `## [Unreleased]` section. When a new version is published, the word `Unreleased` will be replaced with the version number and the date. The section will also be the detailed release notes under releases in Github. The checks on the PR will fail if you don't add any notes in the changelog.
45
+
46
+ ## Signed Commits
47
+
48
+ This is a public repo, one cannot simply trust that a commit came from who it says it did. To ensure the integrity of the commits, all commits must be signed. Your commits and PR will be rejected if they are not signed. Please read more about how to do this here if you do not know how: [Github Signing Commits](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits). Ideally, if you have 1password, please follow these instructions: [1Password Signing Commits](https://blog.1password.com/git-commit-signing/).
49
+
50
+ ## Building Artifacts
51
+
52
+ Build the pip package. This will cache in the build folder and the final output will be in the dist folder. This package is deployed to [pypi](https://pypi.org/project/kubed-krm/).
53
+
54
+ ```sh
55
+ python -m build
56
+ ```
57
+
58
+ ## Version Bump
59
+
60
+ Get the current version:
61
+
62
+ ```sh
63
+ python -m setuptools_scm
64
+ ```
65
+
66
+ When building the artifact the setuptools scm tool will use the a snazzy semver logic to determine version.
67
+
68
+ _ref:_ [SetupTools SCM](https://pypi.org/project/setuptools-scm/)
69
+
70
+ When Ready to publish a new version live, go to the workflow and run the workflow manually. This will bump the version, build the artifact, and push the new version to pypi.
71
+
72
+ ## Docker Image
73
+
74
+ The docker file uses a couple of stages to do a few different tasks. Mainly the official image is the runner target. The bin target is for generating multiarch binaries.
75
+
76
+ Build the main image locally for your machine using compose.
77
+
78
+ ```sh
79
+ docker compose build
80
+ ```
81
+
82
+ Or use bake to for a multiarch image. You just can't export images that are not your arch locally. So use compose to actually build the image locally.
83
+
84
+ ```sh
85
+ docker buildx bake
86
+ ```
87
+
88
+
89
+
90
+ ## Documentation
91
+
92
+ The wiki is a static generated website using mkdocs. All of the resource docs are pulled out from the pydoc strings in the code. The convention for docs in code is [Google style docstrings](https://google.github.io/styleguide/pyguide.html).
93
+
94
+ Here is an example of the docstring format.
95
+
96
+ ```python
97
+ def my_function(param1, param2) -> dict:
98
+ """This is a function that does something.
99
+
100
+ Args:
101
+ param1: The first parameter.
102
+ param2: The second parameter.
103
+
104
+ Returns:
105
+ message: The return value.
106
+
107
+ Raises:
108
+ KubedError: If the value is not correct.
109
+ """
110
+ return {}
111
+ ```
112
+
113
+ ## VSCode Setup
114
+
115
+ To be helpful as possible, all of the sweet spot configurations for VSCode are included in the `.vscode` folder. Although these files are committed they have been ignored from the working tree, so feel free to update them as you see fit and they will not be committed.
116
+
117
+ Here is how git is ignoring the files.
118
+
119
+ ```sh
120
+ git update-index --skip-worktree .vscode/settings.json
121
+ ```
122
+
123
+ ### Step Through Debugging
124
+
125
+ Within the `.vscode/launch.json`, change the `args` to the command you want to debug, this is equivelent to running from the command line. Remember to install the project with `--editable` so you can step through the code easily.
126
+
127
+ ### Tasks
128
+
129
+ All of the commands described above have been implemented as VSCode tasks in the `.vscode/tasks.json`. This goes well with the [spmeesseman.vscode-taskexplorer](https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer) extension which gives you a nice little button to run the tasks.
130
+
131
+ ### Devcontainer
132
+
133
+ The `.devcontainer.json` file is included for quickly spinning up a working enviornment. This is a good way to ensure that all of the dependencies are installed and the correct version of python is being used without fighting with any nuances present in your local environment.
134
+
135
+
@@ -0,0 +1,61 @@
1
+ ARG PY_VERSION=3.12 \
2
+ TARGETPLATFORM \
3
+ BUILDPLATFORM
4
+ ##
5
+ # Base setup step
6
+ # Simply copy project and install
7
+ ##
8
+ FROM python:$PY_VERSION AS setup
9
+ WORKDIR /app
10
+ COPY . .
11
+ RUN <<EOF
12
+ pip install --no-cache-dir --upgrade pip
13
+ pip install --no-cache-dir .[build]
14
+ EOF
15
+
16
+ ##
17
+ # Package builder intermediate step
18
+ # Allows for successive steps to simple copy the built package
19
+ ##
20
+ FROM setup AS builder
21
+ RUN python -m build --no-isolation
22
+
23
+ ##
24
+ # Final runtime image
25
+ # This is pushed to the registry.
26
+ ##
27
+ FROM kubed/krm:latest AS runner
28
+ ARG TARGETPLATFORM \
29
+ BUILDPLATFORM
30
+
31
+ RUN apk --no-cache add \
32
+ python3 \
33
+ py3-pip \
34
+ ncurses
35
+
36
+ COPY --from=builder /app/dist ./dist/
37
+
38
+ RUN pip install --break-system-packages --no-cache-dir ./dist/*.whl && \
39
+ rm -rf ./dist
40
+
41
+ SHELL [ "/bin/bash", "-c" ]
42
+
43
+ CMD ["kubed"]
44
+
45
+ ##
46
+ # Dev container build
47
+ # docs: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/python-3/README.md
48
+ # Makes the dev container environment
49
+ ##
50
+ FROM mcr.microsoft.com/vscode/devcontainers/python:${PY_VERSION} AS dev
51
+ ARG NODE_VERSION="none" \
52
+ KUSTOMIZE_VERSION="v5.7.1" \
53
+ TARGETPLATFORM \
54
+ BUILDPLATFORM
55
+ RUN <<EOF
56
+ export DEBIAN_FRONTEND=noninteractive && apt-get update
57
+ apt-get -y install --no-install-recommends direnv python3-venv
58
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
59
+ curl -L "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" | tar -xz -C /usr/local/bin kustomize
60
+ chmod +x /usr/local/bin/kustomize
61
+ EOF
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 DuploCloud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = ./docs
9
+ BUILDDIR = ./dist/docs
10
+
11
+ .PHONY: help Makefile clean image
12
+
13
+ build:
14
+ pip3 install . --cache-dir dist/cache -t dist/target
15
+ pip3 install -r docs/requirements.txt
16
+
17
+ # Put it first so that "make" without argument is like "make help".
18
+ help:
19
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20
+
21
+ clean:
22
+ rm -rf build dist
23
+
24
+ image:
25
+ docker buildx bake -f docker-bake.hcl
26
+
27
+ # Catch-all target: route all unknown targets to Sphinx using the new
28
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
29
+ %: build
30
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
31
+
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: kubed-krm
3
+ Version: 0.0.1
4
+ Summary: Python implementation of the Kubernetes KRM Function Interface
5
+ Author-email: Kelly <admin@kellyferrone.com>
6
+ Maintainer-email: Kelly <admin@kellyferrone.com>
7
+ Project-URL: Homepage, https://github.com/kubed-io
8
+ Project-URL: Documentation, https://github.com/kubed-io/krm-py
9
+ Project-URL: Repository, https://github.com/kubed-io/krm-py
10
+ Project-URL: Issues, https://github.com/kubed-io/krm-py/issues
11
+ Project-URL: Changelog, https://github.com/kubed-io/krm-py/blob/main/CHANGELOG.md
12
+ Project-URL: LatestRelease, https://github.com/kubed-io/krm-py/releases
13
+ Keywords: kubernetes,krm,kustomize,kubectl,krew
14
+ Requires-Python: >=3.10.0
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: requests>=2.22.0
18
+ Requires-Dist: cachetools>=5.2.0
19
+ Requires-Dist: jmespath>=1.0.1
20
+ Requires-Dist: pyyaml>=6.0.1
21
+ Requires-Dist: jsonpatch>=1.33
22
+ Requires-Dist: jsonpointer>=2.4
23
+ Requires-Dist: netaddr>=0.8.0
24
+ Requires-Dist: kubernetes>=33.1.0
25
+ Provides-Extra: build
26
+ Requires-Dist: invoke; extra == "build"
27
+ Requires-Dist: setuptools_scm; extra == "build"
28
+ Requires-Dist: build; extra == "build"
29
+ Requires-Dist: wheel; extra == "build"
30
+ Requires-Dist: twine; extra == "build"
31
+ Requires-Dist: pyinstaller; extra == "build"
32
+ Requires-Dist: toml; extra == "build"
33
+ Requires-Dist: semver; extra == "build"
34
+ Dynamic: license-file
35
+
36
+ # Kubed KRM
37
+
38
+ A python Implementation of KRM function by Kustomize and Google.
39
+
@@ -0,0 +1,4 @@
1
+ # Kubed KRM
2
+
3
+ A python Implementation of KRM function by Kustomize and Google.
4
+
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+
3
+ function krm_clean() {
4
+ rm -rf \
5
+ dist build \
6
+ .coverage .pytest_cache .tmp \
7
+ *.egg-info src/*.egg-info **/__pycache__ \
8
+ .direnv .ruff_cache requirements.txt
9
+
10
+ find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
11
+ }
12
+
13
+ krm_${@}
@@ -0,0 +1,30 @@
1
+ services:
2
+
3
+ kubed-krm-py:
4
+ image: &image kubed/krm-py:latest
5
+ build:
6
+ target: runner
7
+ tags:
8
+ - *image
9
+ - kubed/krm-py:${GIT_SHA:-latest}
10
+ - kubed/krm-py:${GIT_REF:-latest}
11
+ - kubed/krm-py:${GIT_TAG:-latest}
12
+ x-bake:
13
+ platforms:
14
+ - linux/amd64
15
+ - linux/arm64
16
+ cache-to: type=gha,mode=max,scope=kubed-krm-py
17
+ cache-from: type=gha,scope=kubed-krm-py
18
+ container_name: kubed-krm-py
19
+ stdin_open: true
20
+ tty: true
21
+ privileged: true
22
+ volumes:
23
+ - ./examples:/examples
24
+ entrypoint:
25
+ - /bin/bash
26
+ - -c
27
+ command:
28
+ - tail
29
+ - -f
30
+ - /dev/null
@@ -0,0 +1,99 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # This file only contains a selection of the most common options. For a full
4
+ # list see the documentation:
5
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
+
7
+ # -- Path setup --------------------------------------------------------------
8
+
9
+ # If extensions (or modules to document with autodoc) are in another directory,
10
+ # add these directories to sys.path here. If the directory is relative to the
11
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
12
+ #
13
+ import os
14
+ import sys
15
+ sys.path.insert(0, os.path.abspath('../lib'))
16
+ from kubed.krm import common as c, files as f
17
+ import sphinx_theme
18
+ from sphinx_gallery.sorting import FileNameSortKey
19
+
20
+ # -- Project information -----------------------------------------------------
21
+
22
+ project = 'kubed-krm-docs'
23
+ copyright = '2022, Kelly Ferrone'
24
+ author = 'Kelly Ferrone'
25
+
26
+ # The full version, including alpha/beta/rc tags
27
+ release = '0.0.1'
28
+
29
+
30
+ # -- General configuration ---------------------------------------------------
31
+
32
+ # Add any Sphinx extension module names here, as strings. They can be
33
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34
+ # ones.
35
+ extensions = [
36
+ 'sphinx.ext.autodoc',
37
+ 'sphinx.ext.napoleon',
38
+ 'sphinx.ext.todo',
39
+ # 'sphinx_gallery.gen_gallery',
40
+ # 'sphinx.ext.intersphinx',
41
+ 'myst_parser',
42
+ 'sphinx_jinja',
43
+ 'sphinx_rtd_theme',
44
+ 'sphinx_panels',
45
+ 'sphinx_copybutton',
46
+ 'sphinx-jsonschema'
47
+ ]
48
+
49
+ # Add any paths that contain templates here, relative to this directory.
50
+ templates_path = ['_templates']
51
+
52
+ # List of patterns, relative to source directory, that match files and
53
+ # directories to ignore when looking for source files.
54
+ # This pattern also affects html_static_path and html_extra_path.
55
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
56
+
57
+
58
+ # -- Options for HTML output -------------------------------------------------
59
+
60
+ # The theme to use for HTML and HTML Help pages. See the documentation for
61
+ # a list of builtin themes.
62
+ #
63
+ html_theme = 'stanford_theme'
64
+ html_theme_path = [sphinx_theme.get_html_theme_path('stanford-theme')]
65
+
66
+ # Add any paths that contain custom static files (such as style sheets) here,
67
+ # relative to this directory. They are copied after the builtin static files,
68
+ # so a file named "default.css" will overwrite the builtin "default.css".
69
+ html_static_path = ['_static']
70
+
71
+ # sphinx-gallery configuration
72
+ # sphinx_gallery_conf = {
73
+ # # path to your example scripts
74
+ # 'examples_dirs': [],
75
+ # # path to where to save gallery generated output
76
+ # 'gallery_dirs': [],
77
+ # # specify that examples should be ordered according to filename
78
+ # 'within_subsection_order': FileNameSortKey,
79
+ # # directory where function granular galleries are stored
80
+ # 'backreferences_dir': 'gen_modules/backreferences',
81
+ # # Modules for which function level galleries are created. In
82
+ # # this case sphinx_gallery and numpy in a tuple of strings.
83
+ # 'doc_module': ('SampleModule'),
84
+ # }
85
+
86
+ # configuration for intersphinx: refer to the Python standard library.
87
+ intersphinx_mapping = {}
88
+
89
+ myst_enable_extensions = [
90
+ "colon_fence",
91
+ "deflist",
92
+ "linkify",
93
+ "substitution"
94
+ ]
95
+
96
+
97
+ jinja_contexts = {
98
+ 'replicate': f.load_yaml('../examples/replicate/kustomization.yaml')
99
+ }
@@ -0,0 +1,3 @@
1
+ # LastPass Secret
2
+
3
+ Generates a Secret kind based on a secret from extracted from LastPass cli.