Skip to content

Commit bd2e4ba

Browse files
committed
feat(docs): getting logos together
1 parent b2e60e5 commit bd2e4ba

25 files changed

+255
-106
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# kty
1+
<picture>
2+
<source media="(prefers-color-scheme: dark)" srcset="./docs/public/logo-dark-github.gif">
3+
<img alt="logo" src="./docs/public/logo-light-github.gif">
4+
</picture>
25

36
The terminal for Kubernetes. kty is the easiest way to access resources such as
47
pods on your cluster - all without `kubectl`. Once kty is installed on your

docs/.prettierrc.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @format
2+
3+
semi: false
4+
singleQuote: true
5+
proseWrap: always
6+
parser: mdx

docs/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

docs/package.json

+12-8
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
},
2020
"homepage": "https://github.com/grampelberg/kty#readme",
2121
"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"
22+
"@theguild/remark-mermaid": "^0.1.2",
23+
"next": "^14.2.9",
24+
"nextra": "alpha",
25+
"nextra-theme-docs": "alpha",
26+
"posthog-js": "^1.161.3",
27+
"react": "^18.3.1",
28+
"react-dom": "^18.3.1"
2829
},
2930
"devDependencies": {
30-
"@types/node": "18.11.10",
31-
"typescript": "^4.9.3"
31+
"@types/node": "^22.5.4",
32+
"autoprefixer": "^10.4.20",
33+
"postcss": "^8.4.45",
34+
"tailwindcss": "^3.4.11",
35+
"typescript": "^5.6.2"
3236
}
3337
}

docs/pages/_app.tsx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import '../styles/globals.css'
2+
3+
import React, { useEffect } from 'react'
4+
import { useRouter } from 'next/router'
5+
6+
import posthog from 'posthog-js'
7+
import { PostHogProvider } from 'posthog-js/react'
8+
9+
if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_POSTHOG) {
10+
posthog.init(process.env.NEXT_PUBLIC_POSTHOG, {
11+
api_host: 'https://us.i.posthog.com',
12+
loaded: (posthog) => {
13+
if (process.env.NODE_ENV === 'development') posthog.debug()
14+
},
15+
})
16+
}
17+
18+
export default function App({ Component, pageProps }) {
19+
const router = useRouter()
20+
21+
useEffect(() => {
22+
// Track page views
23+
const handleRouteChange = () => posthog?.capture('$pageview')
24+
router.events.on('routeChangeComplete', handleRouteChange)
25+
26+
return () => {
27+
router.events.off('routeChangeComplete', handleRouteChange)
28+
}
29+
}, [])
30+
31+
return (
32+
<PostHogProvider client={posthog}>
33+
<Component {...pageProps} />
34+
</PostHogProvider>
35+
)
36+
}

docs/pages/_meta.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
export default {
2-
index: 'Overview',
2+
'*': {
3+
theme: {
4+
breadcrumb: false,
5+
},
6+
},
7+
index: {
8+
title: 'Overview',
9+
display: 'hidden',
10+
},
11+
'getting-started': 'Getting Started',
12+
architecture: 'Architecture',
313
legal: {
414
title: 'Legal',
515
display: 'hidden',

docs/pages/architecture/_meta.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {}

docs/pages/auth.mdx docs/pages/architecture/access-control.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Authentication and Authorization
1+
# Access Control
22

33
kty utilizes external systems for both authn and authz. To fetch your identity,
44
a combo of OpenID and the `keys` resource in your cluster are used. These map
@@ -38,7 +38,7 @@ flowchart TD
3838
style conn fill:none,stroke:none
3939
```
4040

41-
## Identity (Authentication)
41+
## Authentication
4242

4343
There are two ways for an incoming SSH session to get a user identity:
4444

docs/pages/getting-started.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ From this point, here's a few suggestions for things to check out:
4343
scp -P 2222 me@localhost:/default/my-pod/etc/hosts /tmp
4444
```
4545

46-
- Use your own [OpenID provider](docs/deployment.md#bring-your-own-provider).
46+
- Use your own [OpenID provider](/installation#bring-your-own-provider).
4747

4848
Note: you'll want to install on-cluster to use the tunnelling functionality.
49-
Check out the [helm](docs/deployment.md#helm) docs for a quick way to do that.
49+
Check out the [helm](/installation/helm) docs for a quick way to do that.
5050

5151
[cli-download]: https://github.com/grampelberg/kty/releases
5252
[k3d]: https://k3d.io

docs/pages/deployment.mdx docs/pages/installation.mdx

+20-35
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
# Deployment
1+
import { Callout } from 'nextra/components'
22

3-
The `kty` server needs access to your cluster's API server and credentials to
4-
connect to it. There are a couple ways to do this:
3+
# Installation
4+
5+
You can install kty anywhere that has access to your cluster's API server and
6+
credentials to connect to it. The easiest way to do this is by running it
7+
on-cluster and exposing the server via a load balancer.
58

69
- [On cluster](#on-cluster)
710
- [Off cluster](#off-cluster)
811

912
[gateway-api]: https://gateway-api.sigs.k8s.io
10-
[helm-chart]: #helm
1113
[sa-plugin]:
1214
https://github.com/superbrothers/kubectl-view-serviceaccount-kubeconfig-plugin
13-
[helm-rbac]: helm/templates/rbac.yaml
15+
[helm-rbac]:
16+
https://github.com/grampelberg/kty/blob/main/helm/templates/rbac.yaml
17+
[helm-chart]: /installation/helm
18+
19+
## Configuration
1420

15-
## Features
21+
### Features
1622

1723
All the functionality is controlled via feature flags in the server:
1824

@@ -23,7 +29,7 @@ All the functionality is controlled via feature flags in the server:
2329
- `egress-tunnel` - Provides `ssh -R` forwarding from the cluster to a local
2430
port.
2531

26-
## Bring Your Own Provider
32+
### Bring Your Own Provider
2733

2834
By default, kty provides Github and Google authentication via. [auth0][auth0].
2935
To get your own setup using auth0, check out their [instructions][auth0-setup].
@@ -50,37 +56,16 @@ using helm, there are some things to be aware of:
5056
using the [gateway api][gateway-api] or configuring your ingress controller to
5157
route TCP.
5258

53-
Note: if you're debugging something, instead of setting global verbosity with
54-
`-vv`, use `RUST_LOG=none,kty=debug`. That'll keep other crates that are
55-
especially noisy out of the output.
56-
57-
### Helm
58-
59-
There is a provided `getting-started.yaml` set of values. To install this on
60-
your cluster, you can run:
61-
62-
```bash
63-
helm install kty oci://ghcr.io/grampelberg/helm/kty \
64-
-n kty --create-namespace \
65-
--version $(curl -L https://api.github.com/repos/grampelberg/kty/tags | jq -r '.[0].name' | cut -c2-) \
66-
-f https://raw.githubusercontent.com/grampelberg/kty/main/helm/getting-started.yaml
67-
```
68-
69-
Note: this exposes the kty service externally by default. To get that IP
70-
address, you can run:
71-
72-
```bash
73-
kubectl -n kty get service server --output=jsonpath='{.status.loadBalancer.ingress[0].ip}'
74-
```
75-
76-
For more detailed instructions, take a look at the [README][helm-readme].
77-
78-
[helm-readme]: helm/README.md
59+
<Callout type="info">
60+
If you're debugging something, instead of setting global verbosity with `-vv`,
61+
use `RUST_LOG=none,kty=debug`. That'll keep other crates that are especially
62+
noisy out of the output.
63+
</Callout>
7964

8065
## Off-Cluster
8166

82-
If you're already using jump hosts to get into your cluster, kty can run there.
83-
Here are some things to be aware of:
67+
If you're already using jump hosts to get into your cluster, kty can run there
68+
as well. Here are some things to be aware of:
8469

8570
- Provide credentials by creating a `kubeconfig` that uses the correct service
8671
account. here are [some plugins][sa-plugin] to make this easy. You'll still

docs/pages/installation/helm.mdx

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Callout } from 'nextra/components'
2+
3+
# Helm
4+
5+
There is a provided `getting-started.yaml` set of values. To install this on
6+
your cluster, you can run:
7+
8+
```bash
9+
helm install kty oci://ghcr.io/grampelberg/helm/kty \
10+
-n kty --create-namespace \
11+
--version $(curl -L https://api.github.com/repos/grampelberg/kty/tags | jq -r '.[0].name' | cut -c2-) \
12+
-f https://raw.githubusercontent.com/grampelberg/kty/main/helm/getting-started.yaml
13+
```
14+
15+
Note: this exposes the kty service externally by default. To get that IP
16+
address, you can run:
17+
18+
```bash
19+
kubectl -n kty get service server --output=jsonpath='{.status.loadBalancer.ingress[0].ip}'
20+
```
21+
22+
See the [values.yaml][values.yaml] file for all possible configuration options.
23+
Some of the things that are configurable out of the box:
24+
25+
- Autoscaling
26+
- OpenID provider
27+
- Ingress
28+
29+
<Callout type="warning">
30+
If you're trying to install directly from the repository, you'll need to set
31+
`server.image` to the correct image as it will try and use a placeholder.
32+
</Callout>
33+
34+
[values.yaml]: https://github.com/grampelberg/kty/blob/main/helm/values.yaml

docs/pages/metrics.mdx

-52
This file was deleted.

docs/pages/operations.mdx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Operations
2+
3+
## Monitoring
4+
5+
| Name | Description |
6+
| --- | --- |
7+
| `bytes_received_total` | Total number of bytes received. This should be keyboard input. |
8+
| `channel_bytes_sent_total` | Total number of bytes sent via a channel by IO type (blocking, non-blocking). This is what the UI and raw modes use to send data to the client. It will be different that the amount of bytes `russh` itself. |
9+
| `ssh_clients_total` | Number of incoming connections. |
10+
| `ssh_session_errors_total` | Number of non-IO related unhandled errors at the session level. |
11+
| `session_total` | Number of sessions created. |
12+
| `active_sessions` | Number of currently active sessions. |
13+
| `session_duration_minutes` | Duration of a session in minutes. |
14+
| `unexpected_state_total` | Number of times an unexpected state was encountered. This should only be incremented if there's a bug. |
15+
| `auth_attempts_total` | Number of authentication attempts by method (publickey, interactive). This can seem inflated because `publickey` will always be attempted first and `interactive` will happen at least twice for every success. `auth_results_total` |
16+
| `auth_attempts_total` | Number of auth responses returned by method and result (accept, partial, reject). Note that this can seem inflated because `publickey` is always attempted first and provides a rejection before moving onto other methods. |
17+
| `auth_succeeded_total` | Number of fully authn and authz'd users. After this, users can request a PTY. |
18+
| `code_generated_total` | Number of codes generated for users. This is the first half of the `interactive` mode. |
19+
| `code_checked_total` | Number of codes that have been checked by result (valid, invalid). This is the second half of the `interactive` mode and it is possible that users retry after getting `invalid` because of something on the openid provider side. |
20+
| `container_exec_duration_minutes` | Number of minutes a raw terminal was running exec'd into a pod. |
21+
| `table_filter_total` | Number of times a table was filtered. |
22+
| `widget_views_total` | Number of times a widget was created by resource (container, pod) and type (cmd, log, yaml, ...). |
23+
| `requests_total` | Number of requests that have come in by type (pty, sftp, window_resize). |
24+
| `sftp_active_sessions` | Total number of active sessions currently. |
25+
| `sftp_bytes_total` | Total number of bytes transferred via sftp by direction (read, write). |
26+
| `sftp_files_total` | Total number of files by direction (sent, received). |
27+
| `sftp_stat_total` | Total number of times `stat` was called on a path. |
28+
| `sftp_list_total` | Total number of times `list` was called on a path. |
29+
| `channels_total` | Total number of channel actions by method (open_session, direct_tcpip, ...). |
30+
| `stream_duration_seconds` | Number of seconds a stream was alive by resource and direction. |
31+
| `stream_bytes_total` | Number of bytes transfered by resource, direction and destination. |
32+
| `stream_total` | Total number of streams by resource and direction. |
33+
| `stream_active` | Currently active numberof streams by resource and direction. |

docs/postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

docs/public/ico-dark.png

14.3 KB
Loading

docs/public/logo-dark-500x500.png

15.4 KB
Loading

docs/public/logo-dark-github.gif

126 KB
Loading

docs/public/logo-dark-transparent.png

51.6 KB
Loading

docs/public/logo-dark.gif

153 KB
Loading

docs/public/logo-dark.png

52.6 KB
Loading

docs/public/logo-light-github.gif

145 KB
Loading

docs/public/logo-light.gif

161 KB
Loading

docs/styles/globals.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

docs/tailwind.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
'./pages/**/*.{js,jsx,ts,tsx,md,mdx}',
5+
'./components/**/*.{js,jsx,ts,tsx,md,mdx}',
6+
],
7+
theme: {
8+
extend: {},
9+
},
10+
plugins: [],
11+
}

0 commit comments

Comments
 (0)