multi-tenant K8s cluster for 1000+ users in research and education at a University 31.05.18 [email protected] | Twitter: @chrishuen 1 Christian Hüning (@chrishuen) Lutz Behnke (@cyphefox)
purposes • Students: Try technologies, host small services etc. • Research projects: Host project websites, services and run large workloads in the cloud • Must be simple to use but allow for complex setups! • Large variety in technologies! • 1000+ students • AWS, Azure, GKE etc. not an option due to administrative restrictions 31.05.18 [email protected] | Twitter: @chrishuen 5
their own resources: • Setup consumes too much time Project elapsed before anything runs • Large vendor variety very hard to maintain • Objectives: • Consolidate heterogeneous compute resources • Datacenter De-Fragmentation Due to scarcity of power, cooling and space • Goals: • Democratize Compute Resources • Increase Research & Development ramp-up speed and efficiency • Improve Resource Utilization • Simplify usage 31.05.18 [email protected] | Twitter: @chrishuen 6
Even if setup is automated: • Still leaves configuration of cluster to the users • Does not help in error cases • Does not help with special setups • Essentially same provisioning problem as with VMs • aka: Who gets how many ressources and when? 31.05.18 [email protected] | Twitter: @chrishuen 8
and monitor multiple clusters (i.e. build all the tooling we did to run GKE at Google)” – David Oppenheimer • “(…) with the increasing emergence of "secure container" technologies, this tendency will only increase, primarily driven by resource cost considerations” – Quinton Hoole • Source: https://goo.gl/ypCtzg 31.05.18 [email protected] | Twitter: @chrishuen 9
for login requests and returns JWT token, exposed via Ingress • /authenticate: Endpoint for API-Server to validate incoming tokens 31.05.18 [email protected] | Twitter: @chrishuen 14 kubelogin kubectl K8s-api K8s-ldap HAW-IDM /ldapAuth 200, JWT token Write kube/config Any API call /authenticate OK / NOK proceed LDAP bind Bind ok
and course work at HAW is done via Gitlab • We built a Gitlab Integrator Service which: • maps Groups, Projects and Personal Repos to Namespaces • maps User roles from Gitlab to RoleBindings • also applies PodSecurityPolicies & Docker Registry Secrets • supports Webhook feature and full-sync every 3 hours • allows for namespaces to be excluded from synchronization • kube-system “cleaned up” , whooops • sets up K8s Integration in Gitlab (i.e. for Continuous Delivery) • can run inside of cluster or externally 31.05.18 [email protected] | Twitter: @chrishuen 17
many things • Reengineering: • Tenant Operator/Controller • Adapters for sources of truth like Gitlab, Github, LDAP, etc… • Discussion at https://goo.gl/CQFvd8 • And in Multi-Tenancy Workgroup: • Mailing List: https://goo.gl/fZ8g6B • Slack: https://kubernetes.slack.com/messages/wg-multitenancy • Deep Dive at KubeCon 2018: https://youtu.be/Vi3ptlNjZJE • Come in, join the fun ☺ ! 31.05.18 [email protected] | Twitter: @chrishuen 18
Runs CEPH cluster as Pods in Kubernetes • Same benefits for your storage cluster as you have for your apps • Requires persistent storage for ceph-mon storage to be shutdown/restart-safe Mount /var/lib/rook to extra hard-drive • BTW: No need for multiple pools due to single, large cluster! ☺ 31.05.18 [email protected] | Twitter: @chrishuen 25
via Prometheus-Operator • No multi-tenancy yet, suggestions? • GPGPU pods via https://github.com/NVIDIA/k8s-device-plugin • Especially great with JupyterHub: https://github.com/jupyterhub/jupyterhub • Dynamic Nodes from PC-Pools • Add up to 1.2 TB memory and 600 cores • Utilizes the csrapproval-controller (since K8s 1.7) 31.05.18 [email protected] | Twitter: @chrishuen 27
Go-Live in September 2017 (Winter-Semester) • ~150 concurrent users • 2 very heavy users (master theses) • Sort of brought down the cluster several times ☺ • Several problems showed up: 31.05.18 [email protected] | Twitter: @chrishuen 28
of capacity: • Increased memory to 32GB • Increased Cores to 4 • Increased API Server count to 6 • However: Problems persisted • kubectl commands timed out • Deployments didn’t start • Nodes failed due to API-Servers not responding • etcd? 31.05.18 [email protected] | Twitter: @chrishuen 30
slowness ;-) • Switch to pure SSD storage recommended! 31.05.18 [email protected] | Twitter: @chrishuen 32 Dez 12 09:13:23 icc-etcd-1 etcd[3875]: failed to send out heartbeat on time (exceeded the 100ms timeout for 228.310831ms) Dez 12 09:13:23 icc-etcd-1 etcd[3875]: server is likely overloaded Dez 12 09:13:23 icc-etcd-1 etcd[3875]: failed to send out heartbeat on time (exceeded the 100ms timeout for 228.294797ms) Dez 12 09:13:23 icc-etcd-1 etcd[3875]: server is likely overloaded
limit of 2GB • etcd only accepted READ and DELETE requests • Increase the size via --quota-backend-bytes flag • Max is 8GB • Effectively caused downtime for 1 day; services remained up • Recovery took about 7 hours at full utilization 31.05.18 [email protected] | Twitter: @chrishuen 34
• etcd really is your Pet and you want to make it feel good: • Multi-Tenancy possible but complex • Requires especially good monitoring, logging & auditing • Students are very curious and use the new technologies • Profs embrace it too and build courses around it 31.05.18 [email protected] | Twitter: @chrishuen 35