2022-09-29 14:22:08 +00:00
# convention 4 kubernetes: c4k-website
2022-11-08 15:23:10 +00:00
[![Clojars Project ](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-website.svg )](https://clojars.org/org.domaindrivenarchitecture/c4k-website) [![pipeline status ](https://gitlab.com/domaindrivenarchitecture/c4k-website/badges/master/pipeline.svg )](https://gitlab.com/domaindrivenarchitecture/c4k-website/-/commits/main)
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
[<img src="https://domaindrivenarchitecture.org/img/delta-chat.svg" width=20 alt="DeltaChat"> chat over e-mail ](mailto:buero@meissa-gmbh.de?subject=community-chat ) | [<img src="https://meissa-gmbh.de/img/community/Mastodon_Logotype.svg" width=20 alt="team@social.meissa-gmbh.de"> team@social.meissa-gmbh.de ](https://social.meissa-gmbh.de/@team ) | [Website & Blog ](https://domaindrivenarchitecture.org )
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
## Purpose
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
Delivering cryogen generated static sites with the push of a few buttons.
2022-07-27 07:14:01 +00:00
2022-11-10 12:13:55 +00:00
c4k-website generates configuration files for multiple nginx webservers, and
corresponding cryogen static site generator build containers. This automatically downloads a branch.zip
from a specified gitea API url. You need an authorization token to access the specified gitea user
account. The build container is based on clojure:lein.
2022-07-27 07:14:01 +00:00
2022-11-10 12:13:55 +00:00
Following the example in valid-config.edn and valid-auth.edn you can add as many websites as you like (provided you have the DNS Routes set up). One set of configmaps, deployment, services etc will be created for each element in the :websites and :auth list.
2022-10-21 14:09:02 +00:00
2022-11-10 12:13:55 +00:00
Configs generated by c4k-website consists of the following parts:
* nginx webserver + service + ingress + certificate definitions
* job definition that initially starts a build container
* cron job for building and build secret for storing auth data
* respective volume claim
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
## Try out
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
Click on the image to try out live in your browser:
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
[![Try it out ](doc/tryItOut.png "Try out yourself" )](https://domaindrivenarchitecture.org/pages/dda-provision/c4k-website/)
2022-09-08 12:12:19 +00:00
2022-09-29 14:22:08 +00:00
Your input will stay in your browser. No server interaction is required.
2022-09-08 12:12:19 +00:00
2022-09-29 14:22:08 +00:00
## Setup
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
You need:
2022-07-27 07:14:01 +00:00
2022-10-21 14:09:02 +00:00
* DNS routes matching the fqdns in the lists
2022-09-29 14:22:08 +00:00
* cryogen as a static site generator
* a cryogen project ready to build
* and a gitea account which holds the buildable project
2022-11-10 12:08:09 +00:00
* a kubernetes cluster provisioned by [provs]
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
Before deploying, you need an authorization token, that can be generated in your gitea account.
Then you need a URL that points to: `https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/main.zip` .
Add this to your auth.edn config file and you should be ready to go.
2022-07-27 07:14:01 +00:00
2022-09-29 14:22:08 +00:00
Let c4k-website generate your .yaml file and `kubectl apply yourApp.yaml` . Done.
2022-07-27 07:12:32 +00:00
## License
2022-09-29 14:22:08 +00:00
Copyright © 2022 meissa GmbH
Licensed under the [Apache License, Version 2.0 ](LICENSE ) (the "License")
Pls. find licenses of our subcomponents [here ](doc/SUBCOMPONENT_LICENSE )
2022-11-10 12:08:09 +00:00
2022-11-10 12:13:55 +00:00
[provs]: https://gitlab.com/domaindrivenarchitecture/provs/