From a900551a58c7ee4fc5274e0231c12f68584da126 Mon Sep 17 00:00:00 2001 From: jem Date: Sat, 5 Jun 2021 17:27:42 +0200 Subject: [PATCH] more refactoring --- README.md | 4 ++-- doc/Development.md | 18 +++++++++--------- package.json | 9 +++++---- project.clj | 6 +++--- public/index.html | 8 ++++---- src/main/clj/dda/c4k_keycloak/uberjar.clj | 2 +- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2d872a1..78112d0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # convention 4 kubernetes: c4k-keycloak -[![Clojars Project](https://img.shields.io/clojars/v/dda/k8s-keycloak.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-keycloak) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/commits/master) +[![Clojars Project](https://img.shields.io/clojars/v/dda/c4k-keycloak.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-keycloak) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/-/commits/master) [DeltaChat chat over e-mail](mailto:buero@meissa-gmbh.de?subject=community-chat) | [team@social.meissa-gmbh.de team@social.meissa-gmbh.de](https://social.meissa-gmbh.de/@team) | [Website & Blog](https://domaindrivenarchitecture.org) @@ -9,7 +9,7 @@ c4k-keycloak .... ## Rational -There are many comparable solutions for creating k8s deployments like helm or kustomize. Why do we need another one? +There are many comparable solutions for creating c4k deployments like helm or kustomize. Why do we need another one? * We like the simplicity of kustomize. Yaml in, yaml out, the ability to lint the result and the option to split large yaml files into objects. But a simple overwriting per environment may not be enough ... * We like helm packages. A package encapsulates the setup for an application. On the one hand, but on the other hand we don't like the idea of having to program and debug in a template language. We can program much better in real programming languages. diff --git a/doc/Development.md b/doc/Development.md index d318a4d..bcb7a0a 100644 --- a/doc/Development.md +++ b/doc/Development.md @@ -58,18 +58,18 @@ sudo ln -s /usr/lib/jvm/graalvm/bin/native-image /usr/local/bin sudo apt-get install build-essential libz-dev zlib1g-dev # build -cd ~/repo/dda/k8s-keycloak +cd ~/repo/dda/c4k-keycloak lein uberjar mkdir -p target/graalvm lein native # execute -./target/graalvm/k8s-keycloak -h -./target/graalvm/k8s-keycloak src/test/resources/valid-config.edn src/test/resources/valid-auth.edn -./target/graalvm/k8s-keycloak src/test/resources/invalid-config.edn src/test/resources/invalid-auth.edn +./target/graalvm/c4k-keycloak -h +./target/graalvm/c4k-keycloak src/test/resources/valid-config.edn src/test/resources/valid-auth.edn +./target/graalvm/c4k-keycloak src/test/resources/invalid-config.edn src/test/resources/invalid-auth.edn ``` -## k8s-setup +## c4k-setup ### install kubectl ``` @@ -89,10 +89,10 @@ tar -xf /tmp/kubeconform.tar.gz sudo cp kubeconform /usr/local/bin ``` -### remote access to k8s +### remote access to c4k ``` -scp -r root@devops.test.meissa-gmbh.de:/home/k8s/.kube ~/ +scp -r root@devops.test.meissa-gmbh.de:/home/c4k/.kube ~/ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@devops.test.meissa-gmbh.de -L 8002:localhost:8002 -L 6443:192.168.5.1:6443 # add in /etc/hosts "127.0.0.1 kubernetes" @@ -105,6 +105,6 @@ kubectl get pods ### deploy keycloak ``` -java -jar target/uberjar/k8s-keycloak-standalone.jar valid-config.edn valid-auth.edn | kubeconform --kubernetes-version 1.19.0 --strict --skip Certificate - -java -jar target/uberjar/k8s-keycloak-standalone.jar valid-config.edn my-auth.edn | kubectl apply -f - +java -jar target/uberjar/c4k-keycloak-standalone.jar valid-config.edn valid-auth.edn | kubeconform --kubernetes-version 1.19.0 --strict --skip Certificate - +java -jar target/uberjar/c4k-keycloak-standalone.jar valid-config.edn my-auth.edn | kubectl apply -f - ``` diff --git a/package.json b/package.json index d62430d..dfae9ce 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "c4k-keycloak", - "description": "Generate k8s yaml for a keycloak deployment.", + "description": "Generate c4k yaml for a keycloak deployment.", "author": "meissa GmbH", "version": "0.1.5-SNAPSHOT", - "homepage": "https://gitlab.com/domaindrivenarchitecture/k8s-keycloak#readme", - "repository": "https://www.npmjs.com/package/k8s-keycloak", + "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-keycloak#readme", + "repository": "https://www.npmjs.com/package/c4k-keycloak", "license": "APACHE2", "main": "c4k-keycloak.js", "bin": { @@ -14,12 +14,13 @@ "cljs", "keycloak", "k8s", + "c4k", "deplyoment", "yaml", "convention4kubernetes" ], "bugs": { - "url": "https://gitlab.com/domaindrivenarchitecture/k8s-keycloak/issues" + "url": "https://gitlab.com/domaindrivenarchitecture/c4k-keycloak/issues" }, "dependencies": { "js-base64": "^3.6.1", diff --git a/project.clj b/project.clj index d04ec48..bbe2582 100644 --- a/project.clj +++ b/project.clj @@ -1,5 +1,5 @@ (defproject org.domaindrivenarchitecture/c4k-keycloak "0.1.0-SNAPSHOT" - :description "keycloak k8s-installation package" + :description "keycloak c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" :url "https://www.apache.org/licenses/LICENSE-2.0.html"} @@ -23,7 +23,7 @@ :dev {:plugins [[lein-shell "0.5.0"]]} :uberjar {:aot :all :main dda.c4k-keycloak.uberjar - :uberjar-name "k8s-keycloak-standalone.jar" + :uberjar-name "c4k-keycloak-standalone.jar" :dependencies [[org.clojure/tools.cli "1.0.206"] [ch.qos.logback/logback-classic "1.3.0-alpha4" :exclusions [com.sun.mail/javax.mail]] @@ -38,7 +38,7 @@ "native-image" "--report-unsupported-elements-at-runtime" "--initialize-at-build-time" - "-jar" "target/uberjar/k8s-keycloak-standalone.jar" + "-jar" "target/uberjar/c4k-keycloak-standalone.jar" "-H:ResourceConfigurationFiles=graalvm-resource-config.json" "-H:Log=registerResource" "-H:Name=target/graalvm/${:name}"]}) diff --git a/public/index.html b/public/index.html index 53eb390..187bbe1 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ - k8s-mastodon-bot + c4k-mastodon-bot @@ -65,10 +65,10 @@




-
- +
+
diff --git a/src/main/clj/dda/c4k_keycloak/uberjar.clj b/src/main/clj/dda/c4k_keycloak/uberjar.clj index 6cd37b3..2deec99 100644 --- a/src/main/clj/dda/c4k_keycloak/uberjar.clj +++ b/src/main/clj/dda/c4k_keycloak/uberjar.clj @@ -10,7 +10,7 @@ (def usage "usage: - k8s-keycloak {your configuraton file} {your authorization file}") + c4k-keycloak {your configuraton file} {your authorization file}") (s/def ::options (s/* #{"-h"})) (s/def ::filename (s/and string?