From f2c6e78defa88219196f37b353114d1d519c5f85 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Fri, 20 Jun 2025 15:35:40 +1000 Subject: [PATCH] Update gitignore --- .gitignore | 4 - adhoc-config/links-pvc.yaml | 25 +++++ archive/langflow.yaml | 121 ++++++++++++++++++++++++ archive/mysql.yaml | 102 ++++++++++++++++++++ archive/open-webui.yaml | 180 ++++++++++++++++++++++++++++++++++++ 5 files changed, 428 insertions(+), 4 deletions(-) create mode 100644 adhoc-config/links-pvc.yaml create mode 100644 archive/langflow.yaml create mode 100644 archive/mysql.yaml create mode 100644 archive/open-webui.yaml diff --git a/.gitignore b/.gitignore index 57bd0de..c639ce9 100644 --- a/.gitignore +++ b/.gitignore @@ -49,10 +49,6 @@ scripts/*.sh # Ignore any local kubeconfig files kubeconfig* -# Ignore any generated YAML files -*.yaml -*.yml - # Ignore any SSH keys or sensitive files *.pem *.key diff --git a/adhoc-config/links-pvc.yaml b/adhoc-config/links-pvc.yaml new file mode 100644 index 0000000..1e9a98f --- /dev/null +++ b/adhoc-config/links-pvc.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +items: +- apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: links-pvc + namespace: apps + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + storageClassName: nfs-client + volumeMode: Filesystem + # volumeName: pvc-4b5b691d-5df1-4f6b-ba8f-4ac4b3a5209f + status: + accessModes: + - ReadWriteOnce + capacity: + storage: 2Gi + phase: Bound +kind: List +metadata: + resourceVersion: "" diff --git a/archive/langflow.yaml b/archive/langflow.yaml new file mode 100644 index 0000000..ac9261f --- /dev/null +++ b/archive/langflow.yaml @@ -0,0 +1,121 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + namespace: ai + name: langflow-pvc +spec: + accessModes: + - ReadWriteOnce + storageClassName: nfs-client + resources: + requests: + storage: 10Gi +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: langflow + namespace: ai + labels: + app: langflow +spec: + replicas: 1 + revisionHistoryLimit: 2 + selector: + matchLabels: + app: langflow + template: + metadata: + labels: + app: langflow + name: langflow + spec: + containers: + - name: langflow + image: mirror.gcr.io/langflowai/langflow:1.3.4 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 7860 + name: web + protocol: TCP + env: + - name: GENERIC_TIMEZONE + value: "Australia/Melbourne" + - name: TZ + value: "Australia/Melbourne" + - name: LANGFLOW_CONFIG_DIR + value: "/var/lib/langflow" + - name: LANGFLOW_SAVE_DB_IN_CONFIG_DIR + value: "true" + - name: LANGFLOW_REDIS_HOST + value: "redis-master.db" + - name: LANGFLOW_REDIS_PORT + value: "6379" + - name: LANGFLOW_CACHE_TYPE + value: "memory" + - name: LANGFLOW_PORT + value: "7860" + - name: DO_NOT_TRACK + value: "true" + volumeMounts: + - name: data + mountPath: "/var/lib/langflow" + resources: + requests: + cpu: 400m + memory: 1Gi + limits: + cpu: 1000m + memory: 2Gi + volumes: + - name: data + persistentVolumeClaim: + claimName: langflow-pvc + +--- + +apiVersion: v1 +kind: Service +metadata: + name: langflow + labels: + name: langflow +spec: + type: ClusterIP + selector: + app: langflow + ports: + - name: langflow + targetPort: web + port: 80 + protocol: TCP + +--- + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: langflow-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: "letsencrypt-prod" + nginx.ingress.kubernetes.io/auth-url: "https://id.junv.cc/oauth2/auth" + nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.cc/oauth2/start?rd=https%3A%2F%2F$host$request_uri" +spec: + tls: + - hosts: + - langflow.junv.cc + secretName: langflow-tls-new + rules: + - host: langflow.junv.cc + http: + paths: + - backend: + service: + name: langflow + port: + number: 80 + path: / + pathType: Prefix diff --git a/archive/mysql.yaml b/archive/mysql.yaml new file mode 100644 index 0000000..71fbbeb --- /dev/null +++ b/archive/mysql.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mysql +spec: + replicas: 1 + selector: + matchLabels: + app: mysql + template: + metadata: + labels: + app: mysql + spec: + nodeSelector: + kubernetes.io/hostname: server-3 + tolerations: + - key: "node" + operator: "Equal" + value: "special" + effect: "NoSchedule" + - key: node-role.kubernetes.io/master + operator: Equal + value: "" + effect: NoSchedule + - key: node-role.kubernetes.io/control-plane + operator: Equal + value: "" + effect: NoSchedule + containers: + - name: mysql + image: mirror.gcr.io/mysql:8.2 + ports: + - containerPort: 3306 + env: + - name: TZ + value: "Australia/Melbourne" + - name: MYSQL_DATABASE + value: home + - name: MYSQL_USER + value: junv + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: mysql-password-junv + key: password + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysql-root-password + key: password + volumeMounts: + - name: data + mountPath: "/var/lib/mysql" + resources: + limits: + cpu: "1" + memory: "1Gi" + requests: + cpu: "400m" + memory: "256Mi" + securityContext: + privileged: false + runAsGroup: 1000 + # fsGroup: 1000 + runAsUser: 1000 + volumes: + - name: data + persistentVolumeClaim: + claimName: mysql-local-pvc + +--- +apiVersion: v1 +kind: Service +metadata: + name: mysql-adguard + namespace: db + annotations: + metallb.universe.tf/loadBalancerIPs: 192.168.1.201 +spec: + selector: + app: mysql + ports: + - protocol: TCP + port: 3306 + targetPort: 3306 + type: LoadBalancer + externalIPs: + - 192.168.1.201 + +--- +apiVersion: v1 +kind: Service +metadata: + name: mysql +spec: + selector: + app: mysql + ports: + - protocol: TCP + port: 3306 + targetPort: 3306 diff --git a/archive/open-webui.yaml b/archive/open-webui.yaml new file mode 100644 index 0000000..805b68a --- /dev/null +++ b/archive/open-webui.yaml @@ -0,0 +1,180 @@ +# # source https://github.com/lobehub/lobe-chat +# apiVersion: v1 +# kind: PersistentVolumeClaim +# metadata: +# namespace: ai +# name: open-webui-pvc +# spec: +# accessModes: +# - ReadWriteOnce +# storageClassName: nfs-client +# resources: +# requests: +# storage: 10Gi +# --- + +# apiVersion: v1 +# kind: Service +# metadata: +# name: open-webui +# namespace: ai +# spec: +# ports: +# - port: 8080 +# targetPort: 8080 +# selector: +# app: open-webui +# --- + +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: open-webui +# spec: +# revisionHistoryLimit: 2 +# selector: +# matchLabels: +# app: open-webui +# replicas: 1 +# template: +# metadata: +# labels: +# app: open-webui +# spec: +# volumes: +# - name: data +# persistentVolumeClaim: +# claimName: open-webui-pvc +# containers: +# - name: open-webui +# image: ghcr.io/open-webui/open-webui:main +# # imagePullPolicy: +# ports: +# - containerPort: 8080 +# env: +# - name: OPENAI_API_BASE_URL +# value: "https://api.openai.com/v1" +# - name: OPENAI_API_KEY +# valueFrom: +# secretKeyRef: +# name: openai-key +# key: key +# - name: SEARXNG_QUERY_URL +# value: http://searxng.home-apps:8080/ +# - name: ENABLE_OLLAMA_API +# value: "false" +# - name: USE_OLLAMA +# value: "false" +# - name: USE_OLLAMA_DOCKER +# value: "true" +# # - name: OPENAI_API_KEY +# # value: "0p3n-w3bu!" +# # - name: OPENAI_API_BASE_URL +# # value: "http://open-webui-pipeline.ai:9090" +# resources: +# requests: +# cpu: 300m +# memory: 512Mi +# limits: +# cpu: 1000m +# memory: 1024Mi +# volumeMounts: +# - name: data +# mountPath: /app/backend/data + + +# --- +# apiVersion: networking.k8s.io/v1 +# kind: Ingress +# metadata: +# name: open-webui-ingress +# annotations: +# kubernetes.io/ingress.class: "nginx" +# kubernetes.io/tls-acme: "true" +# cert-manager.io/cluster-issuer: "letsencrypt-prod" +# nginx.ingress.kubernetes.io/auth-url: "https://id.junv.cc/oauth2/auth" +# nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.cc/oauth2/start?rd=https%3A%2F%2F$host$request_uri" +# spec: +# tls: +# - hosts: +# - ai.junv.cc +# secretName: open-webui-tls +# rules: +# - host: ai.junv.cc +# http: +# paths: +# - backend: +# service: +# name: open-webui +# port: +# number: 8080 +# path: / +# pathType: Prefix + +# --- +# apiVersion: v1 +# kind: Service +# metadata: +# name: open-webui-pipeline +# namespace: ai +# spec: +# ports: +# - port: 9099 +# targetPort: 9099 +# selector: +# app: open-webui-pipeline +# --- + +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: open-webui-pipeline +# spec: +# revisionHistoryLimit: 2 +# selector: +# matchLabels: +# app: open-webui-pipeline +# replicas: 1 +# template: +# metadata: +# labels: +# app: open-webui-pipeline +# spec: +# volumes: +# - name: pipelines +# persistentVolumeClaim: +# claimName: open-webui-pipeline-pvc +# containers: +# - name: open-webui-pipeline +# image: ghcr.io/open-webui/pipelines:main +# imagePullPolicy: IfNotPresent +# ports: +# - containerPort: 9099 +# # env: +# # - name: SEARXNG_QUERY_URL +# # value: http://searxng.home-apps:8080/ +# resources: +# requests: +# cpu: 200m +# memory: 256Mi +# limits: +# cpu: 1000m +# memory: 1024Mi +# volumeMounts: +# - name: pipelines +# mountPath: /app/pipelines + +# --- + +# apiVersion: v1 +# kind: PersistentVolumeClaim +# metadata: +# namespace: ai +# name: open-webui-pipeline-pvc +# spec: +# accessModes: +# - ReadWriteOnce +# storageClassName: nfs-client +# resources: +# requests: +# storage: 10Gi