# convention 4 kubernetes: c4k-common [![Clojars Project](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-common-clj.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-common-clj) [![Clojars Project](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-common-cljs.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-common-cljs) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-common/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-common/-/commits/master) [ chat over e-mail](mailto:buero@meissa-gmbh.de?subject=community-chat) | [ team@social.meissa-gmbh.de](https://social.meissa-gmbh.de/@team) | [Website & Blog](https://domaindrivenarchitecture.org) ## Rationale There are many comparable solutions for creating c4k deployments like `helm` or `kustomize`. `kustomize` is great to manage your k8s manifests by splitting huge files into handy parts. `helm` is great because of its large community. Why do we need another one? Why do you continue the reading here? We combine the simplicity of `kustomize` with the ability for doing real programming as software developers would do. Following the principle "Use programming language for programming" we are clearly enjoy writing kubernetes manifests with clojure. In comparison with helms templating, things such as business logic, conventions, input validation, versions, dependencies and reuse are much easier and much more reliable to implement. By the way, c4k means "convention for kubernetes". ### Features c4k-common supports the following use cases: - [convention 4 kubernetes: c4k-common](#convention-4-kubernetes-c4k-common) - [Rationale](#rationale) - [Features](#features) - [Target Cli and Web Frontend](#target-cli-and-web-frontend) - [Separate Configuration from Credentials](#separate-configuration-from-credentials) - [Input as EDN or Yaml](#input-as-edn-or-yaml) - [Inline k8s resources for versioning \& dependencies](#inline-k8s-resources-for-versioning--dependencies) - [Work on structured Data instead flat Templating](#work-on-structured-data-instead-flat-templating) - [Validate your inputs](#validate-your-inputs) - [Namespaces](#namespaces) - [Ingress](#ingress) - [Postgres Database](#postgres-database) - [Monitoring with Grafana Cloud](#monitoring-with-grafana-cloud) - [Refactoring \& Module Overview](#refactoring--module-overview) - [Development \& mirrors](#development--mirrors) - [License](#license) #### Target Cli and Web Frontend Set up your cli as follows ```clojure (defn -main [& cmd-args] (uberjar/main-common "c4k-forgejo" ;; name of your app core/config? ;; schema for config validation core/auth? ;; schema for credential validation core/config-defaults ;; want to set default values? core/k8s-objects ;; the function generate the k8s manifest cmd-args ;; command line arguments given )) ``` The full example can be found here: https://repo.prod.meissa.de/meissa/c4k-forgejo/src/branch/main/src/main/clj/dda/c4k_forgejo/uberjar.clj You can create your manifest as web-application also (using page local js without server interaction) ```html html>