{ "info": { "author": "ReallyLiri", "author_email": "reallyliri@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# kondunite\n\n[![PyPI version](https://badge.fury.io/py/kondunite.svg)](https://badge.fury.io/py/kondunite)\n\n**Kubernetes Conditional Manifests Unifier**\n\nThe tool is used to unify Kubernetes manifests targeting a specific release, by using hints in the manifest files.\n\nCurrently only yaml manifests are supported.\n\n*Tool is written and tested only in Python 3.7*\n\n## Install\n\n```bash\npip install --upgrade kondunite\n```\n\n## Usage\n\nTerminology - \n* target - a platform for which we might want to apply the manifests to. i.e GKE.\n* repl - short for [replicated](https://help.replicated.com/).\n\n```text\nUsage: kondunite [OPTIONS] DIRECTORY\n\nOptions:\n --no-recurse Do not recurse manifests directory\n -t, --target TEXT Conditional target for unification [required]\n -i, --img TEXT One or more tag to specific images, provide values in\n the forms of 'image-name:tag', i.e\n gcr.io/company/server:1.0\n -b, --repl-base TEXT Base replicated yaml definition (for '#kind:\n replicated' section), defaults to\n /replicated_base.yaml\n -o, --output TEXT File to write the unified yaml to, defaults to\n .yaml\n -r, --repl Plot output for a replicated release (with '# kind:\n scheduler-kubernetes' annotations)\n --repl-registry TEXT One or more docker registries defined in your\n Replicated settings in the form of endpoint:name, i.e\n gcr.io/company\n --help Show this message and exit.\n```\n\nWhere `DIRECTORY` is the path to a directory containing the Kubernetes manifests.\n\nCurrently all filenames across all subdirectories must be unique. Only one of the file instances will be picked if this assumption does not hold.\n\n### Options\n\n* `--img`: Used to override image tags in the manifests. Can also be used if the manifests contain only placeholder tags.\n* `--repl-base`: File containing the basic replicated release file definitions. See [documentation](https://help.replicated.com/docs/kubernetes/packaging-an-application/yaml-format/).\n* `--repl-registry`: Specify the Docker registries to be configured in the replicated release file. See [documentation](https://help.replicated.com/docs/kubernetes/getting-started/docker-registries/).\n\n### Examples\n\n```bash\nkondunite --target gke -i neo4j:lat3st -i gcr.io/kondunite/test:1.0 ./k8s\nkondunite --target repl -i neo4j:late5t -i gcr.io/kondunite/test:1.0 --repl --repl-registry gcr.io/kondunite ./k8s\n```\n\nFor more detailed examples see [examples](https://github.com/reallyliri/kondunite/tree/master/examples).\n\n## Manifests Hints\n\nSome hints could be injected to the Kubernetes manifests to utilize the power of this tool.\n\nNoe the hints will make the manifests syntactically invalid by Kubernetes definitions and must be parse by this tool to be applicable.\n\n### targetsOnly\n\nSpecify at manifest top level that it only targets a specific platform.\n\n```yaml\ntargetsOnly: \n```\n\nFor example:\n\n```yaml\napiVersion: v1\nkind: PersistentVolumeClaim\ntargetsOnly: gke\nmetadata:\n name: pvc\nspec:\n accessModes:\n - ReadWriteMany\n storageClassName: \"\"\n resources:\n requests:\n storage: 17Gi\n```\n\n### dependencies\n\nSpecify apply-time dependencies for the manifests, meaning which manifest should be applied before which. You can specify one or more.\n\nIn case of a circular dependency a `toposort.CircularDependencyError` will be raised with a descriptive message.\n\nIt is assumed that manifests in the same file should maintain their definition order.\n\n```yaml\ndependencies:\n - filename1.yaml\n - filename2.yaml\n```\n\nCurrently only filenames are supported (not paths). So if the files in dependency reside in different directories they could still be declared as dependent without specifying their relation. Note recurring filenames are currently not supported. \n\nFor example:\n\n```yaml\napiVersion: v1\nkind: PersistentVolumeClaim\ndependencies:\n - nfs.yaml\n - pv.yaml\nmetadata:\n name: pvc\nspec:\n accessModes:\n - ReadWriteMany\n storageClassName: \"\"\n resources:\n requests:\n storage: 17Gi\n```\n\n### `-` yaml node suffix\n\nIf any node in a manifest is named with a `-` suffix, it will be filtered out if the target mismatches the requested target.\n\nThe feature is only supported for dict or list nodes, meaning not for low level nodes such as strings etc.\nSince Kubernetes manifests use only camel casing, a dash character should not appear in any (non low level) node that does not intend to hint on a target.\n\nThis hint act similar to `targets_only` hint, however it applies only to a node and not to a whole manifest.\n\n```yaml\n-:\n ...\n```\n\nFor example:\n\n```yaml\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n name: pvc\nspec:\n accessModes-gke:\n - ReadWriteOnce\n accessModes-repl:\n - ReadWriteMany\n storageClassName: \"\"\n resources:\n requests-gke:\n storage: 17Gi\n requests-repl:\n storage: 7Gi\n```\n\n(Note `accessMode` and `requests` nodes)\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: neo4j\nspec:\n strategy:\n type: Recreate\n selector:\n matchLabels:\n app: neo4j\n template:\n metadata:\n labels:\n app: neo4j\n spec:\n containers:\n - name: neo4j\n image: neo4j:latest\n env-repl:\n - name: NEO_PASSWORD\n valueFrom:\n secretKeyRef:\n name: neo4j\n key: neo-password\n env-gke:\n - name: NEO_PASSWORD\n value: 'password'\n```\n\n(Note `env` node)\n\n## Dev Setup\n\nCreate a virtualenv: `python3 -m venv ./venv`\n\nAnd activate it: `source dev.sh`\n\nInstall requirements: `pip install -r requirements.txt`\n\nInstall package: `pip install --editable .`\n\n## Deployment\n\nPackage is deployed using Google Cloud Build. See [cloudbuild.yaml](https://github.com/reallyliri/kondunite/tree/master/cloudbuild.yaml).\n\nAny push to `master` branch will trigger a push to pypi if package version was increased.\n\nFor a push to any branch, a sanity wheel build will run.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ReallyLiri/kondunite", "keywords": "k8s kubernetes kustomize yaml yml manifest gke repl replicated", "license": "", "maintainer": "", "maintainer_email": "", "name": "kondunite", "package_url": "https://pypi.org/project/kondunite/", "platform": "", "project_url": "https://pypi.org/project/kondunite/", "project_urls": { "Homepage": "https://github.com/ReallyLiri/kondunite" }, "release_url": "https://pypi.org/project/kondunite/0.1.10/", "requires_dist": [ "Click", "ruamel.yaml", "toposort" ], "requires_python": ">=3.6", "summary": "Kubernetes Conditional Manifests Unifier", "version": "0.1.10" }, "last_serial": 5803009, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "83c4073b08a8bd4984b8a790394ced35", "sha256": "d141a62706d6da840bdc24d96975bd28709debc8201189b20a8ad88fb385103c" }, "downloads": -1, "filename": "kondunite-0.1.10-py3-none-any.whl", "has_sig": false, "md5_digest": "83c4073b08a8bd4984b8a790394ced35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10069, "upload_time": "2019-09-09T10:47:10", "url": "https://files.pythonhosted.org/packages/06/00/3091373f85378dc67f5f8912bde5fc2616fb5638428f80681820ac8ce4d0/kondunite-0.1.10-py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "0aeb7a98d9de695a74db0cf69f94d7be", "sha256": "33e2b18a53d35cc9a81d6faa25a37645beb1c4c9ef9191589db0048b22374021" }, "downloads": -1, "filename": "kondunite-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "0aeb7a98d9de695a74db0cf69f94d7be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6194, "upload_time": "2019-08-28T05:57:17", "url": "https://files.pythonhosted.org/packages/1c/19/1ed55c748c6f490ebe2e3ac5ab92c51d03a998833e98a28cc158b295fa39/kondunite-0.1.5-py3-none-any.whl" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "be7f5576c3af645acce1377df9e4caad", "sha256": "bdab6581b86b6295f485849f938a627f9b8f4b599fab19630ddb7e5dc6a1ed66" }, "downloads": -1, "filename": "kondunite-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "be7f5576c3af645acce1377df9e4caad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5706, "upload_time": "2019-08-28T06:44:32", "url": "https://files.pythonhosted.org/packages/73/cd/f1500c138408fcb69abffeeb17de32f9a678a790677456e61fb716b46fd8/kondunite-0.1.6-py3-none-any.whl" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "a69b4d99adedb643302bdeddf3ae157a", "sha256": "c712c71225ca05b02d9108b1434369d93501d33417a1b03555581ce2a477aa15" }, "downloads": -1, "filename": "kondunite-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "a69b4d99adedb643302bdeddf3ae157a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10082, "upload_time": "2019-08-28T07:27:08", "url": "https://files.pythonhosted.org/packages/2a/2b/b5b0b1159e17f4ba600c7db276be1d857e7806101cdc45fb49093c7591f9/kondunite-0.1.7-py3-none-any.whl" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "ab35c9316df72bfe460c8a9f7fac94a6", "sha256": "556aad19943cd3bd08d1f08bf182be6bc55742bc80e1b6bee95936a5c68649d2" }, "downloads": -1, "filename": "kondunite-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "ab35c9316df72bfe460c8a9f7fac94a6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10014, "upload_time": "2019-08-28T07:29:38", "url": "https://files.pythonhosted.org/packages/b0/a5/8ec0466770a1f118fff1b685439ea22eada7502ad5a383fe30567c0bc4fa/kondunite-0.1.8-py3-none-any.whl" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "c8e091dd9fce3ea28345cd6a6f072e0e", "sha256": "48c0b3675c1f14b519a144dc10f77a50d6af214ad240137754155b50781ce7b1" }, "downloads": -1, "filename": "kondunite-0.1.9-py3-none-any.whl", "has_sig": false, "md5_digest": "c8e091dd9fce3ea28345cd6a6f072e0e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10021, "upload_time": "2019-09-02T08:50:54", "url": "https://files.pythonhosted.org/packages/e9/66/19c85be4c79da22e0b25a94a4059c04dcedccd5283b27c8646d0f93c247a/kondunite-0.1.9-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "83c4073b08a8bd4984b8a790394ced35", "sha256": "d141a62706d6da840bdc24d96975bd28709debc8201189b20a8ad88fb385103c" }, "downloads": -1, "filename": "kondunite-0.1.10-py3-none-any.whl", "has_sig": false, "md5_digest": "83c4073b08a8bd4984b8a790394ced35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10069, "upload_time": "2019-09-09T10:47:10", "url": "https://files.pythonhosted.org/packages/06/00/3091373f85378dc67f5f8912bde5fc2616fb5638428f80681820ac8ce4d0/kondunite-0.1.10-py3-none-any.whl" } ] }