agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.4k stars 523 forks source link

Kubernetes #1082

Open jbonnett92 opened 5 years ago

jbonnett92 commented 5 years ago

Please can you add Kubernetes support?

hosquiat commented 5 years ago

+1

jnsvd commented 5 years ago

+1 (Willing to contribute on this)

aheinze commented 5 years ago

Sorry, but I'm totally unexperienced with Kubernetes. What is missing?

jnsvd commented 5 years ago

At the moment there is only Docker support, which is not sufficient if you want to integrate the CMS in a managed containerised environment, i.e. Kubernetes. Integrating in CI/CD pipelines would also require a bit of additional work.

For example:

Most of these "missing" things can be implemented by anyone that wants to set it up in Kubernetes, but it would be more convenient to have it wrapped in a package. Ideally a Helm chart for Cockpit would exist here: https://github.com/helm/charts/tree/master/stable

jdbohrman commented 5 years ago

I'd love to help on this as well!

jdbohrman commented 5 years ago

www.codefresh.com is the ticket for CI/CD. It's a really awesome CI/CD platform built specifically to take advantage of containers and the native entities in Kubernetes.

jdbohrman commented 5 years ago

At the moment there is only Docker support, which is not sufficient if you want to integrate the CMS in a managed containerised environment, i.e. Kubernetes.

Yeah this is definitely true.

Integrating in CI/CD pipelines would also require a bit of additional work.

This isn't completely true, you should check out Codefresh, it would really save you some time.

jbonnett92 commented 5 years ago

This does not require CI/CD but rather a template YAML file made for integrating Kubernetes

mpern commented 5 years ago

It's "just" a matter of providing a sane default config.php that reads everything from environment variables, and of course, removing the requirement to hit /install (there should be a way to either provide the admin password for the bootstrap, or you auto-generate a safe one during startup)

With this in place, writing a helm chart and/or a kustomization.yaml is possible.

abenelazar commented 5 years ago

I would also like to help with this! I'm lacking the PHP expertise to make it happen, but I tried on my own for a bit.

mpern commented 5 years ago

Maybe it would also make sense to add capabilities to load parts of the config from files to avoid leaking secrets to the environment variables

https://kubernetes.io/docs/concepts/configuration/secret/

tiagoacardoso commented 5 years ago

As I'm aware, this CMS uses filesystem for first read the collections and just then access the DB Driver (mongo for example) to really read the content, but that's not the only problem.

When using Kubernetes, you should not rely on the disk, since you can kill/restart/(not being able to use replicas) and you are going to loose everything on the disk itself.

Since Cockpit uses Flysystem, you can mount a Google Storage Bucket for replace the filesystem disk usage, anyway all those "$this->helpers('fs') in Collections" won't work.

mpern commented 5 years ago

Either you mount a persistent volume to store collections, or you provide a possibility to configure a different adapter for Flysystem so you can target a cloud-native store (like a AWS S3, Google Cloud Storage, Azure Blob...)

Persistent Volume / Persistent Volume Claim would be vendor agnostic...

decentral1se commented 4 years ago

This should then be split into two specific tickets: 1) allow to configure the config.php through the environment and 2) remove requirement to need to visit /install, perhaps by adding another configuration flag in config.php?

beasteers commented 4 years ago

Hey! So in case anyone is still looking for Cockpit Kubernetes support, I've put out a couple of PRs.

The Helm Chart ~PR is here: https://github.com/agentejo/cockpit/pull/1361~ is now in a dedicated repo: https://github.com/beasteers/cockpit-helm

and the admin autoinstall version is here: https://github.com/agentejo/cockpit/pull/1257. I also pushed up this branch as a docker image beasteers/cockpit:autoinstall

I know the core devs are busy and it takes a long time to get things merged so I'll try and keep on top of things. Also, I'm happy to take contributions cuz it works but it's definitely not complete yet!