refactor: Update Traefik ingress routes file paths

This commit is contained in:
2024-08-18 07:38:16 +08:00
parent 2da4bdc13e
commit 820191346b
10 changed files with 530 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# Ngnix Ingress
```bash
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install nginx ingress-nginx/ingress-nginx \
--create-namespace \
--namespace nginx-system
```
+13
View File
@@ -0,0 +1,13 @@
# plane
```bash
helm repo add makeplane https://helm.plane.so/
helm repo update
helm install plane-app makeplane/plane-ce \
--create-namespace \
--namespace plane-ce \
-f values.yaml \
--timeout 10m \
--wait \
--wait-for-jobs
```
+123
View File
@@ -0,0 +1,123 @@
planeVersion: stable
dockerRegistry:
enabled: false
host: "index.docker.io/v1/"
loginid: makeplane
password: ""
ingress:
enabled: true
appHost: "plane.local"
minioHost: "plane-minio.local"
ingressClass: "nginx"
ingress_annotations: {
"nginx.ingress.kubernetes.io/proxy-body-size": "5m",
}
# SSL Configuration - Valid only if ingress.enabled is true
ssl:
createIssuer: false
issuer: "http" # Allowed : cloudflare, digitalocean, http
token: "" # not required for http
server: https://acme-v02.api.letsencrypt.org/directory
email: plane@example.com
generateCerts: false
redis:
local_setup: true
image: valkey/valkey:7.2.5-alpine
servicePort: 6379
storageClass: longhorn
volumeSize: 1Gi
pullPolicy: IfNotPresent
postgres:
local_setup: true
image: postgres:15.5-alpine
servicePort: 5432
cliConnectPort: ""
storageClass: longhorn
volumeSize: 5Gi
pullPolicy: IfNotPresent
minio:
image: minio/minio:latest
local_setup: true
pullPolicy: IfNotPresent
root_password: password
root_user: admin
storageClass: longhorn
volumeSize: 5Gi
web:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-frontend
pullPolicy: IfNotPresent
space:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-space
pullPolicy: IfNotPresent
admin:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-admin
pullPolicy: IfNotPresent
api:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-backend
pullPolicy: IfNotPresent
worker:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-backend
pullPolicy: IfNotPresent
beatworker:
replicas: 1
memoryLimit: 1000Mi
cpuLimit: 500m
image: makeplane/plane-backend
pullPolicy: IfNotPresent
env:
pgdb_username: plane
pgdb_password: plane
pgdb_name: plane
pgdb_remote_url: "" #INCASE OF REMOTE PG DB URL ONLY
# NEXT_PUBLIC_DEPLOY_URL: ""
# REDIS
remote_redis_url: "" #INCASE OF REMOTE REDIS ONLY
# POSTGRES DB VALUES
# DATA STORE
docstore_bucket: "uploads"
doc_upload_size_limit: "5242880" # 5MB
# REQUIRED IF MINIO LOCAL SETUP IS FALSE
aws_access_key: ""
aws_secret_access_key: ""
aws_region: ""
aws_s3_endpoint_url: ""
secret_key: "60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5"
sentry_dsn: ""
sentry_environment: ""
cors_allowed_origins: ""
default_cluster_domain: cluster.local
+38
View File
@@ -0,0 +1,38 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cleanup-service-account
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cleanup-admin
subjects:
- kind: ServiceAccount
name: cleanup-service-account
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: Job
metadata:
name: cleanup-job
namespace: kube-system
labels:
app: cleanup
spec:
template:
spec:
containers:
- name: cleanup
image: rancher/rancher-cleanup:latest
args: [ "force" ]
imagePullPolicy: Always
serviceAccountName: cleanup-service-account
restartPolicy: Never
backoffLimit: 4
+45
View File
@@ -0,0 +1,45 @@
# kubunetes cluster
## Create a cluster
```bash
```
## Delete a cluster
```bash
```
## Get cluster info
```bash
```
## Get cluster status
```bash
```
## Get cluster logs
```bash
```
## Get cluster events
```bash
```
## Get cluster nodes
```bash
```
## Delete rancher
### Using the cleanup script
Run as a Kubernetes Job
```bash
k create -f rancher-cleanup.yaml
kubectl -n kube-system logs -l job-name=cleanup-job -f
```
Verify that the job has completed
```bash
kubectl apply -f verify.yaml
kubectl -n kube-system logs -l job-name=verify-job -f
kubectl -n kube-system logs -l job-name=verify-job -f | grep -v "is deprecated"
```
@@ -0,0 +1,47 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: myingressroute
namespace: default
spec:
entryPoints:
- web
routes:
- match: Host(`test.traefik.local`) && PathPrefix(`/bar`)
kind: Rule
services:
- name: whoami
port: 80
---
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroute.tcp
namespace: default
spec:
entryPoints:
- tcpep
routes:
- match: HostSNI(`testtcp.traefik.local`)
services:
- name: whoamitcp
port: 8080
---
apiVersion: traefik.io/v1alpha1
kind: IngressRouteUDP
metadata:
name: ingressroute.udp
namespace: default
spec:
entryPoints:
- udpep
routes:
- services:
- name: whoamiudp
port: 8080
+8
View File
@@ -0,0 +1,8 @@
# traefik ingress route
## Description
```bash
k apply -f ingress_route.yaml -f whoami.yaml
http://test.traefik.local/bar
k delete -f ingress_route.yaml -f whoami.yaml
```
@@ -0,0 +1,82 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: traefik
labels:
app: traefik
spec:
replicas: 1
selector:
matchLabels:
app: traefik
template:
metadata:
labels:
app: traefik
spec:
serviceAccountName: traefik-ingress-controller
containers:
- name: traefik
image: traefik:v3.1
args:
- --log.level=DEBUG
- --api
- --api.insecure
- --entryPoints.web.address=:80
- --entryPoints.tcpep.address=:8000
- --entryPoints.udpep.address=:9000/udp
- --providers.kubernetescrd
ports:
- name: web
containerPort: 80
- name: admin
containerPort: 8080
- name: tcpep
containerPort: 8000
- name: udpep
containerPort: 9000
---
apiVersion: v1
kind: Service
metadata:
name: traefik
spec:
type: LoadBalancer
selector:
app: traefik
ports:
- protocol: TCP
port: 80
name: web
targetPort: 80
- protocol: TCP
port: 8080
name: admin
targetPort: 8080
- protocol: TCP
port: 8000
name: tcpep
targetPort: 8000
---
apiVersion: v1
kind: Service
metadata:
name: traefikudp
spec:
type: LoadBalancer
selector:
app: traefik
ports:
- protocol: UDP
port: 9000
name: udpep
targetPort: 9000
+126
View File
@@ -0,0 +1,126 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: whoami
namespace: default
labels:
app: traefiklabs
name: whoami
spec:
replicas: 2
selector:
matchLabels:
app: traefiklabs
task: whoami
template:
metadata:
labels:
app: traefiklabs
task: whoami
spec:
containers:
- name: whoami
image: traefik/whoami
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: default
spec:
ports:
- name: http
port: 80
selector:
app: traefiklabs
task: whoami
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: whoamitcp
namespace: default
labels:
app: traefiklabs
name: whoamitcp
spec:
replicas: 2
selector:
matchLabels:
app: traefiklabs
task: whoamitcp
template:
metadata:
labels:
app: traefiklabs
task: whoamitcp
spec:
containers:
- name: whoamitcp
image: traefik/whoamitcp
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: whoamitcp
namespace: default
spec:
ports:
- protocol: TCP
port: 8080
selector:
app: traefiklabs
task: whoamitcp
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: whoamiudp
namespace: default
labels:
app: traefiklabs
name: whoamiudp
spec:
replicas: 2
selector:
matchLabels:
app: traefiklabs
task: whoamiudp
template:
metadata:
labels:
app: traefiklabs
task: whoamiudp
spec:
containers:
- name: whoamiudp
image: traefik/whoamiudp:latest
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: whoamiudp
namespace: default
spec:
ports:
- port: 8080
selector:
app: traefiklabs
task: whoamiudp
+38
View File
@@ -0,0 +1,38 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cleanup-service-account
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cleanup-admin
subjects:
- kind: ServiceAccount
name: cleanup-service-account
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: Job
metadata:
name: verify-job
namespace: kube-system
labels:
app: verify
spec:
template:
spec:
containers:
- name: verify
image: rancher/rancher-cleanup:latest
command: [ "verify.sh" ]
imagePullPolicy: Always
serviceAccountName: cleanup-service-account
restartPolicy: Never
backoffLimit: 0