Skip to content

Commit b2e60e5

Browse files
committed
feat(docs): moved to a nextra docs website
1 parent ffc16d1 commit b2e60e5

22 files changed

+664
-151
lines changed

.envrc.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export RUST_LOG=none,kuberift=debug
3+
export RUST_LOG=none,kty=debug
44
export LOCAL_REGISTRY="kty:5432"
55

66
# export GHCR_USER="me"

.gitignore

+143-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Generated by Cargo
1+
# =========== Project ===========
2+
3+
tmp
4+
.DS_Store
5+
.envrc
6+
CHANGELOG.md
7+
bun.lockb
8+
9+
helm/charts
10+
11+
# =========== Rust ===========
12+
213
# will have compiled files and executables
314
debug/
415
target/
@@ -13,9 +24,135 @@ target/
1324

1425
/target
1526

16-
tmp
17-
.DS_Store
18-
.envrc
19-
CHANGELOG.md
27+
# =========== Node ===========
2028

21-
helm/charts
29+
# Logs
30+
logs
31+
*.log
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*
35+
lerna-debug.log*
36+
.pnpm-debug.log*
37+
38+
# Diagnostic reports (https://nodejs.org/api/report.html)
39+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
40+
41+
# Runtime data
42+
pids
43+
*.pid
44+
*.seed
45+
*.pid.lock
46+
47+
# Directory for instrumented libs generated by jscoverage/JSCover
48+
lib-cov
49+
50+
# Coverage directory used by tools like istanbul
51+
coverage
52+
*.lcov
53+
54+
# nyc test coverage
55+
.nyc_output
56+
57+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
58+
.grunt
59+
60+
# Bower dependency directory (https://bower.io/)
61+
bower_components
62+
63+
# node-waf configuration
64+
.lock-wscript
65+
66+
# Compiled binary addons (https://nodejs.org/api/addons.html)
67+
build/Release
68+
69+
# Dependency directories
70+
node_modules/
71+
jspm_packages/
72+
73+
# Snowpack dependency directory (https://snowpack.dev/)
74+
web_modules/
75+
76+
# TypeScript cache
77+
*.tsbuildinfo
78+
79+
# Optional npm cache directory
80+
.npm
81+
82+
# Optional eslint cache
83+
.eslintcache
84+
85+
# Optional stylelint cache
86+
.stylelintcache
87+
88+
# Microbundle cache
89+
.rpt2_cache/
90+
.rts2_cache_cjs/
91+
.rts2_cache_es/
92+
.rts2_cache_umd/
93+
94+
# Optional REPL history
95+
.node_repl_history
96+
97+
# Output of 'npm pack'
98+
*.tgz
99+
100+
# Yarn Integrity file
101+
.yarn-integrity
102+
103+
# dotenv environment variable files
104+
.env
105+
.env.development.local
106+
.env.test.local
107+
.env.production.local
108+
.env.local
109+
110+
# parcel-bundler cache (https://parceljs.org/)
111+
.cache
112+
.parcel-cache
113+
114+
# Next.js build output
115+
.next
116+
out
117+
118+
# Nuxt.js build / generate output
119+
.nuxt
120+
dist
121+
122+
# Gatsby files
123+
.cache/
124+
# Comment in the public line in if your project uses Gatsby and not Next.js
125+
# https://nextjs.org/blog/next-9-1#public-directory-support
126+
# public
127+
128+
# vuepress build output
129+
.vuepress/dist
130+
131+
# vuepress v2.x temp and cache directory
132+
.temp
133+
.cache
134+
135+
# Docusaurus cache and generated files
136+
.docusaurus
137+
138+
# Serverless directories
139+
.serverless/
140+
141+
# FuseBox cache
142+
.fusebox/
143+
144+
# DynamoDB Local files
145+
.dynamodb/
146+
147+
# TernJS port file
148+
.tern-port
149+
150+
# Stores VSCode versions used for testing VSCode extensions
151+
.vscode-test
152+
153+
# yarn v2
154+
.yarn/cache
155+
.yarn/unplugged
156+
.yarn/build-state.yml
157+
.yarn/install-state.gz
158+
.pnp.*

README.md

+5-144
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# kty
22

3-
SSH into Kubernetes. kty is the easiest way to access resources such as pods on
4-
your cluster - all without `kubectl`. Once kty is installed on your cluster,
5-
`ssh` gives you a dashboard to interact with the cluster.
3+
The terminal for Kubernetes. kty is the easiest way to access resources such as
4+
pods on your cluster - all without `kubectl`. Once kty is installed on your
5+
cluster, `ssh` gives you a dashboard to interact with the cluster.
66

77
You can:
88

@@ -22,148 +22,9 @@ maps Kubernetes concepts to SSH. It relies on OpenID providers such as Github or
2222
Google to verify your identity. Kubernetes RBAC validates access, just like
2323
`kubectl` does, respecting your organizational policies.
2424

25-
![demo](./assets/demo.gif)
26-
27-
## Documentation
28-
29-
- [Architecture](docs/architecture.md)
30-
- [Auth][auth] - Deep dive on what's happening around auth and what the minimum
31-
permissions are for each piece of functionality.
32-
- [Deployment](docs/deployment.md) - Figure out how to get running on your own
33-
cluster.
34-
- [Development](DEVELOPMENT.md) - Some tips and tricks for doing development on
35-
kty itself.
36-
- [Metrics](docs/metrics.md) - List of the possible metrics exported via.
37-
prometheus.
38-
39-
[auth]: docs/auth.md
40-
41-
## Getting Started
42-
43-
1. Download the [cli][cli-download] and add it to your `$PATH`.
44-
1. Get a k8s cluster. [k3d][k3d] is a convenient way to get a cluster up and
45-
running fast. Follow their installation instructions and create a default
46-
cluster.
47-
1. Grant your email address access to the cluster. Choose `cluster-admin` if
48-
you'd like something simple to check out how things work. For more details on
49-
the minimum possible permissions, read the [Authorization][auth] section. The
50-
email address is what you'll be using to authenticate against. It can either
51-
be the one associated with a google or github account. Note, the ID used for
52-
login and the providers available can all be configured.
53-
54-
```bash
55-
kty users grant <cluster-role> <email-address>
56-
```
57-
58-
1. Start the server.
59-
60-
```bash
61-
kty --serve
62-
```
63-
64-
1. SSH into your cluster!
65-
66-
```bash
67-
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 me@localhost
68-
```
69-
70-
From this point, here's a few suggestions for things to check out:
71-
72-
- Start a new pod. It'll show up in the dashboard immediately!
73-
74-
- Exec into a pod. Select the pod you want and go to the `Shell` tab. You'll be
75-
able to pick the command to exec and then be shell'd into the pod directly.
76-
77-
- Follow the logs. Logs for all containers in a pod are streamed to the `Logs`
78-
tab when you've selected a pod from the main list.
79-
80-
- `scp` some files out of a container:
81-
82-
```bash
83-
scp -P 2222 me@localhost:/default/my-pod/etc/hosts /tmp
84-
```
85-
86-
- Use your own [OpenID provider](docs/deployment.md#bring-your-own-provider).
87-
88-
Note: you'll want to install on-cluster to use the tunnelling functionality.
89-
Check out the [helm](docs/deployment.md#helm) docs for a quick way to do that.
90-
91-
[cli-download]: https://github.com/grampelberg/kty/releases
92-
[k3d]: https://k3d.io
93-
94-
## Interaction
95-
96-
### SSH
97-
98-
To get to the dashboard, you can run:
25+
Visit the [docs](https://kty.dev) to get started!
9926

100-
```bash
101-
ssh anything@my-remote-host-or-ip -p 2222
102-
```
103-
104-
The provided username is not used as your identity is authenticated via other
105-
mechanisms.
106-
107-
### Ingress Tunnel (`ssh -L`)
108-
109-
You can forward requests from a local port into a resource on the remote
110-
cluster. The supported resources are `nodes`, `pods` and `services`. See the
111-
[authorization][auth] section for details on required RBAC.
112-
113-
To forward port 9090 on your local system to 80 on the cluster, you can run:
114-
115-
```bash
116-
ssh me@my-cluster -p 2222 -L 9090:service/default/remote-service:80
117-
```
118-
119-
The first time 9090 is accessed, a connection will be made. Pay attention to the
120-
dashboard as any errors establishing this session will be reflected there.
121-
122-
The connection string format is `<resource>/<namespace>/<name>`. As nodes are
123-
not namespaced, the format is `<resource>/<name>`.
124-
125-
Unlike the API server proxy, this works for any TCP service and is not limited
126-
to HTTP/HTTPS. For example, you can ssh directly to a node in the cluster with:
127-
128-
```bash
129-
ssh me@my-cluster -p 2222 -L 3333:no/my-node:22
130-
```
131-
132-
With that running in one terminal, you can run this in another:
133-
134-
```bash
135-
ssh my-node-username@localhost -p 3333
136-
```
137-
138-
### Egress Tunnel (`ssh -R`)
139-
140-
You can forward a remote service on your cluster to a port on your local host.
141-
142-
To forward port 8080 on service `default/kty` to port `9090` on your local
143-
system, you can run:
144-
145-
```bash
146-
ssh me@my-cluster -p 2222 -R default/kty:8080:localhost:9090
147-
```
148-
149-
The format for service definitions is `<namespace>/<service-name>`.
150-
151-
### SFTP
152-
153-
The cluster is represented by a file tree:
154-
155-
```bash
156-
/<namespace>/<pod-name>/<container-name>/<file-path>
157-
```
158-
159-
For the `nginx` pod running in `default`, you would do something like:
160-
161-
```bash
162-
scp -P 2222 me@localhost:/default/nginx/nginx/etc/hosts /tmp
163-
```
164-
165-
It can be a little easier to navigate all this with an sftp client as that'll
166-
render the file tree natively for you.
27+
![demo](./assets/demo.gif)
16728

16829
## Releases
16930

docs/.mise.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
node = "22.2.0"
3+
bun = "1.1.27"

docs/next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

docs/next.config.mjs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import nextra from 'nextra'
2+
3+
const withNextra = nextra({
4+
theme: 'nextra-theme-docs',
5+
themeConfig: './theme.config.tsx',
6+
latex: true,
7+
search: {
8+
codeblocks: false,
9+
},
10+
})
11+
12+
export default withNextra({
13+
reactStrictMode: true,
14+
})

docs/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "kty",
3+
"version": "0.0.1",
4+
"type": "module",
5+
"description": "kty",
6+
"scripts": {
7+
"dev": "next dev",
8+
"build": "next build",
9+
"start": "next start"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/grampelberg/kty.git"
14+
},
15+
"author": "Thomas Rampelberg <thomas@saunter.org>",
16+
"license": "Apache-2.0",
17+
"bugs": {
18+
"url": "https://github.com/grampelberg/kty/issues"
19+
},
20+
"homepage": "https://github.com/grampelberg/kty#readme",
21+
"dependencies": {
22+
"next": "^13.0.6",
23+
"nextra": "latest",
24+
"nextra-logo": "^0.1.3-beta.1",
25+
"nextra-theme-docs": "latest",
26+
"react": "^18.2.0",
27+
"react-dom": "^18.2.0"
28+
},
29+
"devDependencies": {
30+
"@types/node": "18.11.10",
31+
"typescript": "^4.9.3"
32+
}
33+
}

docs/pages/_meta.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
index: 'Overview',
3+
legal: {
4+
title: 'Legal',
5+
display: 'hidden',
6+
},
7+
}
File renamed without changes.

docs/auth.md docs/pages/auth.mdx

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)