It’s My HomeLab Why Would I Want SSO?
Matt Williams – Evangelist @ Infra matt@infrahq.com | @technovangelist
Slide 2
It’s My HomeLab Why Would I Want Single Sign On? Or Roles? Or Users? * Specific to Kubernetes
Matt Williams – Evangelist @ Infra matt@infrahq.com | @technovangelist
Slide 3
A HomeLab can be whatever you want it to be.
Slide 4
Slide 5
A HomeLab can be made of whatever you have
Slide 6
My first HomeLab was…
Slide 7
My HomeLab Today
Slide 8
Slide 9
Slide 10
Slide 11
Slide 12
Kubernetes in the HomeLab Can take advantage of a hodgepodge of machines
Slide 13
Kubernetes in the HomeLab Consistent Deployments
Slide 14
Why Users and Roles in K8S at Home?
Slide 15
Kubernetes: What is a User? They don’t exist - or – • A signed certificate in a kubeconfig file •
Kubernetes: What is a Role? •
Defines the level of access a ‘user’ has to the cluster • •
Resource Verb
Slide 21
Kubernetes: What is a Role? apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: marketing-dev labels: app.infrahq.com/include-role: “true” rules: - apiGroups: [“”] # “” indicates the core API group resources: [“pods”] verbs: [“get”, “watch”, “list”]
Slide 22
Kubernetes: What is a Role? apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: marketing-dev labels: app.infrahq.com/include-role: “true” rules: - apiGroups: [“”] # “” indicates the core API group resources: [“pods”] verbs: [“get”, “watch”, “list”]
Slide 23
Kubernetes: What is a Role? apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: marketing-dev labels: app.infrahq.com/include-role: “true” rules: - apiGroups: [“”] # “” indicates the core API group resources: [“pods”] verbs: [“get”, “watch”, “list”]
Slide 24
Kubernetes: What is a Role? apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: marketing-dev labels: app.infrahq.com/include-role: “true” rules: - apiGroups: [“”] # “” indicates the core API group resources: [“pods”] verbs: [“get”, “watch”, “list”]
Slide 25
How to create a User Create the user key (openssl genpkey…) • Create the CSR (openssl req –new) • Submit the CSR to the cluster (yaml) • Approve the request (kubectl certificate •
approve…)
Slide 26
How to create a User Get the approved request (kubectl get csr…) • Build the kubeconfig (kubectl —kubeconfig •
myuserconfig config set-credentials, kubectl -kubeconfig myuserconfig configset-context)
•
Then distribute the file
https://infrahq.com/blog/how-to-create-users
Slide 27
How to create a User •
And then repeat often •
•
ensure bad parties can’t access
And redistribute
Slide 28
Just give everyone admin??? •
What happens when User fired • User compromised •
•
Kubernetes is Remote Execution as a Service
What’s missing from the script •
Key / Config file distribution
Slide 32
How about something easier?
Slide 33
Slide 34
Infra •
Two deployment options Self Hosted • Use Infra Cloud (coming soon) •
Slide 35
Demo
Slide 36
Summary HomeLabs let you practice • You should be using Users/Roles/SSO with K8s • Users in K8s are hard • Infra is easy • Infra lets you do the hard stuff without much thinking •
Slide 37
It’s My HomeLab Why Would I Want SSO?
Matt Williams – Evangelist @ Infra matt@infrahq.com | @technovangelist