openfaas / faas-netes

Serverless Functions For Kubernetes
https://www.openfaas.com
MIT License
2.13k stars 472 forks source link

Create instructions for faas-netes on OpenShift #349

Closed alexellis closed 4 years ago

alexellis commented 5 years ago

We should create instructions for deploying OpenFaaS on OpenShift.

Michael Hausenblas once worked on this and wrote up a blog using minishift, but it wasn't signed-off, so couldn't be merged. The project has changed since then and I'd appreciate an experienced OpenShift user taking a look at this and contributing changes back to this repo and openfaas/docs.

annatech commented 5 years ago

Having recently deployed faas-netes on a self-hosted OpenShift OKD 3.11 cluster, I can follow-up with a document describing my work. Overall, I was able to use the instructions from here, mostly as-is:

https://github.com/openfaas/faas-netes/blob/master/chart/openfaas/README.md

The actual deployment was performed using a helm chart, executed from one of the OpenShift master nodes. After the kubectl command was run to create the namespaces and helm deployed the containers, I moved to OpenShift for the rest of the configuration. Since I had already setup a fully-functional and ssl-secured cluster, service routes were easy to deploy over HTTPS.

Finally, I did have to create a network bridge between the openfaas and openfaas Projects (a.k.a "namespaces" in k8s). This was primarily due to my having chosen the multi-tenant network plugin which segments Pods between projects by default.

The advantage of deploying on OpenShift is that container management and route configuration is a breeze. Tasks which are a chore in pure k8s are often entirely UI-driven or orchestrated by compact "oc" CLI commands. The RBAC, network segmentation and cluster management tools make it better suited for "enterprise" deployments. The downside is that the minimum requirements are much higher than, say, Docker Swarm... so no Raspberry Pi's for this one.

alexellis commented 5 years ago

Please send a PR to appear here https://docs.openfaas.com/deployment/openshift/

Through editing this file:

https://github.com/openfaas/docs/blob/master/docs/deployment/openshift.md

It should cover:

Using helm + tiller or helm to generate YAML for kubectl apply -f

alexellis commented 4 years ago

the latest update -> https://blog.alexellis.io/openshift-in-a-footloose-container/