Package: kondunite
konduniteKubernetes Conditional Manifests UnifierThe tool is used to unify Kubernetes manifests targeting a specific release, by using hints in the manifest files.Currently only yaml manifests are supported.Tool is written and tested only in Python 3.7Installpipinstall--upgradekonduniteUsageTerminology -target - a platform for which we might want to apply the manifests to. i.e GKE.repl - short forreplicated.Usage: kondunite [OPTIONS] DIRECTORY

Options:
  --no-recurse          Do not recurse manifests directory
  -t, --target TEXT     Conditional target for unification  [required]
  -i, --img TEXT        One or more tag to specific images, provide values in
                        the forms of 'image-name:tag', i.e
                        gcr.io/company/server:1.0
  -b, --repl-base TEXT  Base replicated yaml definition (for '#kind:
                        replicated' section), defaults to
                        <directory>/replicated_base.yaml
  -o, --output TEXT     File to write the unified yaml to, defaults to
                        <target>.yaml
  -r, --repl            Plot output for a replicated release (with '# kind:
                        scheduler-kubernetes' annotations)
  --repl-registry TEXT  One or more docker registries defined in your
                        Replicated settings in the form of endpoint:name, i.e
                        gcr.io/company
  --help                Show this message and exit.WhereDIRECTORYis the path to a directory containing the Kubernetes manifests.Currently all filenames across all subdirectories must be unique. Only one of the file instances will be picked if this assumption does not hold.Options--img: Used to override image tags in the manifests. Can also be used if the manifests contain only placeholder tags.--repl-base: File containing the basic replicated release file definitions. Seedocumentation.--repl-registry: Specify the Docker registries to be configured in the replicated release file. Seedocumentation.Exampleskondunite--targetgke-ineo4j:lat3st-igcr.io/kondunite/test:1.0./k8s
kondunite--targetrepl-ineo4j:late5t-igcr.io/kondunite/test:1.0--repl--repl-registrygcr.io/kondunite./k8sFor more detailed examples seeexamples.Manifests HintsSome hints could be injected to the Kubernetes manifests to utilize the power of this tool.Noe the hints will make the manifests syntactically invalid by Kubernetes definitions and must be parse by this tool to be applicable.targetsOnlySpecify at manifest top level that it only targets a specific platform.targetsOnly:<target>For example:apiVersion:v1kind:PersistentVolumeClaimtargetsOnly:gkemetadata:name:pvcspec:accessModes:-ReadWriteManystorageClassName:""resources:requests:storage:17GidependenciesSpecify apply-time dependencies for the manifests, meaning which manifest should be applied before which. You can specify one or more.In case of a circular dependency atoposort.CircularDependencyErrorwill be raised with a descriptive message.It is assumed that manifests in the same file should maintain their definition order.dependencies:-filename1.yaml-filename2.yamlCurrently 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.For example:apiVersion:v1kind:PersistentVolumeClaimdependencies:-nfs.yaml-pv.yamlmetadata:name:pvcspec:accessModes:-ReadWriteManystorageClassName:""resources:requests:storage:17Gi-<target>yaml node suffixIf any node in a manifest is named with a-<target>suffix, it will be filtered out if the target mismatches the requested target.The feature is only supported for dict or list nodes, meaning not for low level nodes such as strings etc., except for specific allowed nodes like:replicasSince 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.This hint act similar totargets_onlyhint, however it applies only to a node and not to a whole manifest.<node>-<target>:...For example:apiVersion:v1kind:PersistentVolumeClaimmetadata:name:pvcspec:accessModes-gke:-ReadWriteOnceaccessModes-repl:-ReadWriteManystorageClassName:""resources:requests-gke:storage:17Girequests-repl:storage:7Gi(NoteaccessModeandrequestsnodes)apiVersion:apps/v1kind:Deploymentmetadata:name:neo4jspec:strategy:type:Recreateselector:matchLabels:app:neo4jtemplate:metadata:labels:app:neo4jspec:containers:-name:neo4jimage:neo4j:latestenv-repl:-name:NEO_PASSWORDvalueFrom:secretKeyRef:name:neo4jkey:neo-passwordenv-gke:-name:NEO_PASSWORDvalue:'password'(Noteenvnode)replKindAllows a manifest to declare a Replicated kind that is not the default -scheduler-kubernetes.For example:apiVersion:v1kind:PodtargetsOnly:replreplKind:preflight-kubernetesmetadata:name:disk-space-checkerspec:containers:-name:testerimage:busyboxcommand:["sh","-c","[\"$(df-k/host/var|tail-1|xargs|cut-d''-f2)\"-gt\"80000000\"]"]volumeMounts:-name:varmountPath:/host/varvolumes:-name:varhostPath:path:/varDev SetupCreate a virtualenv:python3 -m venv ./venvAnd activate it:source dev.shInstall requirements:pip install -r requirements.txtInstall package:pip install --editable .DeploymentPackage is deployed using Google Cloud Build. Seecloudbuild.yaml.Any push tomasterbranch will trigger a push to pypi if package version was increased.For a push to any branch, a sanity wheel build will run.