Connect to the Server
- Run the following command, where -L mean to forward server's port to local. Because Kubernetes exposes port 6445, we would like to forward it to localhost:6443. The username should just be your Cornell NetID (it's easier to memorize).
ssh -i -L 6445:localhost:6443 username@ssh.diaper-project.com
- You should see a pop-up looks like this, which means that you have already connected to the server.
Connect to Kubernetes
- We first need to install Kubernetes on our local machine. To install using Docker (you might want to use Docker to build images), check out Install and turn on Kubernetes.
- There are various UI explorers for Kubernetes, one of my favorites is called K9S. To install, check out Install (k9scli.io).
- Add the server cluster credentials in the Kubernetes config file. The configuration is as follows:
Code Block language yml theme Eclipse title Kubernetes Config File linenumbers true collapse true apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJlRENDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz756SXpNRFl3SGhjTk1qUXdNakExTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7RRMgpXakFqTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz71WeUxXTmhRREUzTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7BRSUJCZ2dxaGtqT1BRTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7NqNkNIdDlxK3daSUV6N093ajM5VXJmRnoKTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7dTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz70JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz72CnNrWkUzOG93Q2dZSUtvWkl6ajBFQXdJRFNRQXdSZ0loQUxKelRCZTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7KQVkya1cyamcvMy80QWlFQXdhMTlENk1IcThPTTrEPCPrqR3YziyHVBJnibzUcQvxyeVaz7UzdFJvY2c9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K server: https://127.0.0.1:6445 name: diaper-server contexts: - context: cluster: diaper-server user: <Kubernetes service account name> name: diaper-server kind: Config preferences: {} users: - name: <Kubernetes service account name> user: token: <Kubernetes service account token>