diff --git a/README.md b/README.md index 9af9e4c..eebf0d7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,42 @@ -# meissa-cloud +# convention 4 kubernetes: c4k-nextcloud +[![Clojars Project](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-nextcloud.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-nextcloud) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/commits/master) -# backup manuell triggern +[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) -# restore manuell triggern \ No newline at end of file +## Purpose + +c4k-nextcloud provides a k8s deployment for nextcloud containing: +* adjusted nextcloud docker image +* nextcloud +* ingress having a letsencrypt managed certificate +* postgres database + +The package aims to a low load sceanrio. + +## Status + +Stable - we use this setup on production. + +## Try out + +Click on the image to try out live in your browser: + +[![Try it out](doc/tryItOut.png "Try out yourself")](https://domaindrivenarchitecture.org/pages/dda-provision/c4k-nextcloud/) + +Your input will stay in your browser. No server interaction is required. + +You will also be able to try out on cli: +``` +target/graalvm/c4k-nextcloud src/test/resources/valid-config.edn src/test/resources/valid-auth.edn | kubeval - +target/graalvm/c4k-nextcloud src/test/resources/valid-config.edn src/test/resources/valid-auth.edn | kubectl apply -f - +``` + +## Documentation +* [Example Setup on Hetzner](doc/SetupOnHetzner.md) +* Backup and Restore + +## License + +Copyright © 2021 meissa GmbH +Licensed under the [Apache License, Version 2.0](LICENSE) (the "License") +Pls. find licenses of our subcomponents [here](doc/SUBCOMPONENT_LICENSE) \ No newline at end of file diff --git a/doc/SetupOnHetzner.md b/doc/SetupOnHetzner.md new file mode 100644 index 0000000..7ce48cc --- /dev/null +++ b/doc/SetupOnHetzner.md @@ -0,0 +1,74 @@ +# Setup +## Infrastructure on Hetzner / Aws + +For a setup on hetzner / aws we use terraform. + +``` +resource "aws_s3_bucket" "backup" { + bucket = "backup" + acl = "private" + + versioning { + enabled = false + } + tags = { + name = "backup" + Description = "bucket for backups in stage: ${var.stage}" + } +} + +resource "hcloud_server" "cloud_09_2021" { + name = "the name" + image = "ubuntu-20.04" + server_type = "cx31" + location = "fsn1" + ssh_keys = ... + + lifecycle { + ignore_changes = [ssh_keys] + } +} + +resource "aws_route53_record" "v4_neu" { + zone_id = the_dns_zone + name = "cloud-neu" + type = "A" + ttl = "300" + records = [hcloud_server.cloud_09_2021.ipv4_address] +} + +output "ipv4" { + value = hcloud_server.cloud_09_2021.ipv4_address +} + +``` + +## k8s minicluster + +For k8s installation we use our [dda-k8s-crate](https://github.com/DomainDrivenArchitecture/dda-k8s-crate) with the following configuation: + + +``` +{:user :k8s + :k8s {:external-ip "ip-from-above"} + :cert-manager :letsencrypt-prod-issuer + :persistent-dirs ["cloud", "postgres"] + } +``` + +## kubectl apply c4k-nextcloud + +The last step for applying the nextcloud deployment is + +``` +c4k-nextcloud config.edn auth.edn | kubectl apply -f - +``` + +with the following config.edn: + +``` +{:fqdn "the-fqdn-from aws_route53_record.v4_neu" + :cloud-data-volume-path "/var/cloud" ;; Volume was configured at dda-k8s-crate, results in a PersistentVolume definition. + :postgres-data-volume-path "/var/postgres" ;; Volume was configured at dda-k8s-crate, results in a PersistentVolume definition. + :restic-repository "s3:s3.amazonaws.com/your-bucket/your-folder"} +```