<commit_before><commit_msg>add K3s setup instructions. Will automate more in future<commit_after># K3s on Scaleway

1. Install K3s without starting the server
```bash
export INSTALL_K3S_SKIP_START="true"
curl -sfL https://get.k3s.io | sh -
```

## Use Auth0 as an OIDC provider

1. write to `/var/lib/rancher/k3s/server/manifests/oidc-admin.yaml`
```yaml
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: oidc-admin
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: Group
  name: oidc:admin
```

1. Configure K3s to use oidc from Auth0
```
k3s server \
  --tls-san k3s.vjpatel.me \
  --kube-apiserver-arg oidc-issuer-url=https://vjpatel.eu.auth0.com/ \
  --kube-apiserver-arg oidc-client-id=PT1R4dJdij9LqJWJI3a3i1VcIcFXy5Lj \
  --kube-apiserver-arg oidc-username-claim=email \
  --kube-apiserver-arg oidc-username-prefix=oidc: \
  --kube-apiserver-arg oidc-groups-claim=http://schemas.microsoft.com/ws/2008/06/identity/claims/role \
  --kube-apiserver-arg oidc-groups-prefix=oidc:
```

2. Install Krew on your workstation (https://krew.sigs.k8s.io/docs/user-guide/setup/install/)
3. Install https://github.com/int128/kubelogin via `kubectl krew`

```
kubectl config set-credentials default \
	  --exec-api-version=client.authentication.k8s.io/v1beta1 \
	  --exec-command=kubectl \
	  --exec-arg=oidc-login \
	  --exec-arg=get-token \
	  --exec-arg=--oidc-issuer-url=https://vjpatel.eu.auth0.com/ \
	  --exec-arg=--oidc-client-id=PT1R4dJdij9LqJWJI3a3i1VcIcFXy5Lj \
	  --exec-arg=--oidc-extra-scope=profile \
	  --exec-arg=--oidc-extra-scope=email

```

```
kubectl oidc-login setup \
  --oidc-issuer-url=https://vjpatel.eu.auth0.com/ \
  --oidc-client-id=PT1R4dJdij9LqJWJI3a3i1VcIcFXy5Lj \
  --oidc-extra-scope="profile" \
  --oidc-extra-scope="email"
```
{'fraction_non_alphanumeric': 0.16170903190914007, 'fraction_numerical': 0.03028664142779881, 'mean_word_length': 3.5012165450121655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '350584', 'n_tokens_mistral': 849, 'n_tokens_neox': 812, 'n_words': 112}