This commit is contained in:
Mathis 2024-04-26 21:38:38 +00:00
parent ee75d54667
commit a54024a577
6 changed files with 102 additions and 0 deletions

23
infra/k9s/deployment.yaml Executable file
View File

@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: k9s
namespace: k9s
labels:
app: k9s
spec:
replicas: 1
selector:
matchLabels:
app: k9s
template:
metadata:
labels:
app: k9s
spec:
serviceAccountName: k9s-sa
containers:
- name: k9s
image: ghcr.io/lordmathis/k9s-web:latest
ports:
- containerPort: 7681

16
infra/k9s/ingress.yaml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: k9s-ingress
namespace: k9s
spec:
entryPoints:
- websecure
routes:
- match: Host(`k9s.namesny.com`)
kind: Rule
middlewares:
- name: "auth-authelia@kubernetescrd"
services:
- name: k9s-svc
port: 7681

View File

@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: k9s
resources:
- namespace.yaml
- rbac.yaml
- deployment.yaml
- service.yaml
- ingress.yaml

4
infra/k9s/namespace.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: k9s

35
infra/k9s/rbac.yaml Normal file
View File

@ -0,0 +1,35 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: k9s-reader
rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["batch"]
resources: ["*"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: k9s
subjects:
- kind: ServiceAccount
name: k9s-sa
namespace: k9s
roleRef:
kind: ClusterRole
name: k9s-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: k9s-sa
namespace: k9s

13
infra/k9s/service.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: k9s-svc
namespace: k9s
spec:
selector:
app: k9s
type: ClusterIP
ports:
- protocol: TCP
port: 7681
targetPort: 7681