Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a local Getting Started guide for Kubernetes #10620

Merged
merged 5 commits into from
Mar 29, 2022

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Feb 25, 2022

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
kubectl proxy.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

@bearrito
Copy link

bearrito commented Mar 2, 2022

First off thanks to @ptgott for putting this improvement to documentation together. I'm just getting started with Teleport, so a guide showing me how to run locally is a big help.

There is some discrepancy between the guide and usage. Perhaps this is because I'm running minikube in a VBOX?

The one I have found so far has to do with minikube tunnel
My expectation following the guide would be that the External IP would be 127.0.0.1

If this ultimately due to running in a VBOX, I'd be happy to test or contribute anything back.

me@host:~$ kubectl config set-context --current --namespace teleport-cluster
Context "minikube" modified.

me@host:~$ minikube tunnel
Status:	
	machine: minikube
	pid: 487947
	route: 10.96.0.0/12 -> 192.168.59.100
	minikube: Running
	services: [teleport-cluster]
    errors: 
		minikube: no errors
		router: no errors
		loadbalancer emulator: no errors

The 10.x.x.x is internal. The 192.168.59.100 is my VBOX NET
There was no prompt for password

me@host:~$ ip route | grep vboxnet1
10.96.0.0/12 via 192.168.59.100 dev vboxnet1 
192.168.59.0/24 dev vboxnet1 proto kernel scope link src 192.168.59.1 
me@host:~$ kubectl config set-context --current --namespace teleport-cluster
Context "minikube" modified.

me@host:~$ kubectl get pods
NAME                               READY   STATUS    RESTARTS   AGE
teleport-cluster-94b8bdbfd-mgdrh   1/1     Running   0          37m

me@host:~$ kubectl get services 
NAME               TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                                                                     AGE
teleport-cluster   LoadBalancer   10.105.160.217   10.105.160.217   443:31324/TCP,3023:31939/TCP,3026:32419/TCP,3024:31173/TCP,3036:32387/TCP   37m

me@host~$ curl --insecure https://10.105.160.217:443/webapi/ping
{"auth":{"type":"local","second_factor":"otp","preferred_local_mfa":"otp","has_motd":false},"proxy":{"kube":{"enabled":true,"listen_addr":"0.0.0.0:3026"},"ssh":{"listen_addr":"[::]:3023","tunnel_listen_addr":"0.0.0.0:3024","public_addr":"teleport-cluster.teleport-cluster.svc.cluster.local:443"},"db":{"mysql_listen_addr":"0.0.0.0:3036"},"tls_routing_enabled":false},"server_version":"8.3.2","min_client_version":"7.0.0"

EDIT

Here is the routing information from the minikube VM (while the tunnel is active)

$ hostname
minikube
$ ip route
default via 10.0.2.2 dev eth0 proto dhcp src 10.0.2.15 metric 1024 
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 
10.0.2.2 dev eth0 proto dhcp scope link src 10.0.2.15 metric 1024 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 
192.168.59.0/24 dev eth1 proto kernel scope link src 192.168.59.100 

With the way routing is changed when the tunnel is active, I am able to access the k8's dashboard directly from my host machine.

When I do attempt to access it through the Teleport launch, then after a timeout period I get "INTERNAL SERVER ERROR"

Copy link
Contributor

@probakowski probakowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to go through the guide and everything worked correctly with Docker as minikube driver. Left one small suggestion

https://teleport-cluster.teleport-cluster.svc.cluster.local:443/web/invite/<token>
```

Next, open a browser at `https://localhost:443/web/invite/<token>`, copying the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original url (https://teleport-cluster.teleport-cluster.svc.cluster.local:443/web/invite/<token>) worked for me just fine, so maybe we can skip mentioning localhost here and just advice to visit url above?

@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from 6c07217 to c4eadd0 Compare March 4, 2022 21:04
@ptgott
Copy link
Contributor Author

ptgott commented Mar 4, 2022

@bearrito @probakowski Thanks a lot for reviewing this! I've made some changes in response to your feedback.

@ptgott
Copy link
Contributor Author

ptgott commented Mar 4, 2022

@r0mant @zmb3 @xinding33 would one of you have time to review this? Thanks!

@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch 4 times, most recently from b5f043f to 742bb1c Compare March 14, 2022 21:21
@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from 742bb1c to bb0e641 Compare March 16, 2022 20:45
@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from bb0e641 to 0443420 Compare March 18, 2022 21:19
@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from 0443420 to 51ae533 Compare March 22, 2022 21:44
Copy link
Contributor

@xinding33 xinding33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments with a few nits but this is an awesome guide. Great job!

Comment on lines 21 to 25
The **Teleport Auth Service** is the certificate authority for your cluster. It
issues certificates and conducts authentication challenges. The **Teleport Proxy
Service** is the cluster frontend, and handles user requests, forwards user
credentials to the Auth Service, and communicates with other Teleport
instances—called **Nodes**—that enable access to your infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is effectively a list anyway, what do you think of reformatting using list items?

credentials to the Auth Service, and communicates with other Teleport
instances—called **Nodes**—that enable access to your infrastructure.

In our demo, one Node is a pod that runs Teleport's Application Service to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the "Application Service" referenced here? Can we be more specific?

Also, since the next sentence talks about "a second pod..." I think we should just say something along the lines of:

Suggested change
In our demo, one Node is a pod that runs Teleport's Application Service to
We will be running two pods for this demo. The first pod runs...`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this back when I was mistakenly using "Node" to refer to individual resource services. I've edited the wording.

application to create your user.

<Details title="Don't want to use MFA in your local demo?" opened={false}>
We recommend requiring a second factor for all Teleport users. However, for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We recommend requiring a second factor for all Teleport users. However, for
We recommend requiring MFA for all Teleport users in production. However, for

...
```

Copy the join token so you can assign it to `JOIN_TOKEN` below, then launch the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use the terminology invite token in the code block above, I suggest we stick with that here.

Suggested change
Copy the join token so you can assign it to `JOIN_TOKEN` below, then launch the
Copy the invite token so you can assign it to `JOIN_TOKEN` below, then launch the

@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from ae74932 to 0e3bec0 Compare March 25, 2022 22:25
Copy link
Contributor

@ulysseskan ulysseskan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the rest of the guide. It worked great.

I did have to launch the Teleport dashboard in Safari rather than Chromium 99.0.4844.88 though when using the self-signed cert. Chromium gave an error and refused to load the page, and there was no place to add an exception (though there may have been some hidden hotkey I could have pressed to allow it - I forget if this is a thing in Chrome).

I think you have an include about insecure pages already though.

@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from 0e3bec0 to 4b4bf08 Compare March 29, 2022 15:27
ptgott added 5 commits March 29, 2022 14:49
Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359
I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.
@ptgott ptgott force-pushed the paul.gottschling/9359-local-k8s branch from 4b4bf08 to 9591a72 Compare March 29, 2022 18:49
@ptgott ptgott merged commit 38aa32f into master Mar 29, 2022
@ptgott ptgott deleted the paul.gottschling/9359-local-k8s branch March 29, 2022 18:57
ptgott added a commit that referenced this pull request Mar 29, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 29, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 30, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 30, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 30, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 30, 2022
Backports #10620

* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
ptgott added a commit that referenced this pull request Mar 30, 2022
* Add a local Getting Started guide for Kubernetes

Our current Getting Started guides for Teleport on Kubernetes
assume that readers are deploying resources to the cloud. Some
users may want to get started quickly without, say, asking
another team for permission to deploy a DNS zone. These users
can then read our cloud-focused guides when it comes time to
develop a proof of concept or use Teleport in production.

Hopefully, this guide will expand the range of security-minded
engineers who can get early firsthand experience with Teleport.

This guide sets up Teleport on minikube and uses the App Service
to access Kubernetes Dashboard. Because Kubernetes Dashboard is
not initially accessible outside the cluster, this guide shows
you how you can access it securely via Teleport without using
`kubectl proxy`.

We can also consider expanding this guide later on to introduce
the Teleport Kubernetes Service or more sophisticated RBAC rules.

Also worth noting that while this change adds a new tile to
/docs/pages/kubernetes-access/getting-started.mdx, it does not
add a new tile image. We can consider creating a new one or
using the current one.

Fixes #9359

* Respond to PR feedback

I've made it more explicit that the minikube Docker driver is required
for the demo. I have also added a row to the required software table
that includes Docker Desktop/Docker Engine. I've tested this on my
Linux desktop, and modified commands to support Docker Engine as well
as Docker Desktop (i.e., "minikube tunnel" exposes a private IP address
beside 127.0.0.1 for the load balancer).

Also made a couple of minor tweaks, and removed the mention of
localhost in relation to the Web UI.

* Address PR feedback

* Add Details for troubleshooting minikube tunnel

* Ignore the dead link checker for a localhost link
@webvictim webvictim mentioned this pull request Apr 19, 2022
@webvictim webvictim mentioned this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local-only Getting Started Guide for Kubernetes
6 participants