From 797543048964bfe1dfb50e25330317eb20422d12 Mon Sep 17 00:00:00 2001 From: ION606 Date: Sat, 13 Sep 2025 11:56:35 -0400 Subject: [PATCH] GOD I AM SO DUMB --- apps/children/kustomization.yaml | 5 +- ...a-scheduler.yaml => ollama-scheduler.yaml} | 0 manifests/argo-schedules-api/deployment.yaml | 92 +++++++++++-------- manifests/argo-schedules-api/rbac.yaml | 56 +++++------ scheduler/package.json | 25 +++-- 5 files changed, 93 insertions(+), 85 deletions(-) rename apps/children/{argo-ollama-scheduler.yaml => ollama-scheduler.yaml} (100%) diff --git a/apps/children/kustomization.yaml b/apps/children/kustomization.yaml index fb614ca..a41c8d5 100644 --- a/apps/children/kustomization.yaml +++ b/apps/children/kustomization.yaml @@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - argo-ollama-scheduler.yaml + - ollama-scheduler.yaml - coderunner.yaml - tools.yaml - rag-server.yaml @@ -14,10 +14,11 @@ resources: generatorOptions: disableNameSuffixHash: true +# FINDME: The global branch for my repo configMapGenerator: - name: ollama-plus-revs literals: - - targetRevision=main + - targetRevision=argo # Inject targetRevision from the ConfigMap into apps (kill me) replacements: diff --git a/apps/children/argo-ollama-scheduler.yaml b/apps/children/ollama-scheduler.yaml similarity index 100% rename from apps/children/argo-ollama-scheduler.yaml rename to apps/children/ollama-scheduler.yaml diff --git a/manifests/argo-schedules-api/deployment.yaml b/manifests/argo-schedules-api/deployment.yaml index 4b71f25..dbdb729 100644 --- a/manifests/argo-schedules-api/deployment.yaml +++ b/manifests/argo-schedules-api/deployment.yaml @@ -1,46 +1,64 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: schedules-api - namespace: argo + name: ollama-scheduler + namespace: argo spec: - replicas: 1 - selector: - matchLabels: { app: schedules-api } - template: - metadata: - labels: { app: schedules-api } - spec: - serviceAccountName: schedules-api - containers: - - name: schedules-api - # TODO: build & push your image, then update below - image: ghcr.io/your-org/schedules-api:0.1.0 - imagePullPolicy: IfNotPresent - env: - - { name: PORT, value: "3000" } - - { name: NS, value: "argo" } - ports: - - { name: http, containerPort: 3000 } - readinessProbe: - tcpSocket: { port: 3000 } - initialDelaySeconds: 3 - periodSeconds: 10 - livenessProbe: - tcpSocket: { port: 3000 } - initialDelaySeconds: 10 - periodSeconds: 20 - resources: - requests: { cpu: "50m", memory: "64Mi" } - limits: { cpu: "200m", memory: "256Mi" } + replicas: 1 + selector: + matchLabels: + - app: ollama-scheduler + template: + metadata: + labels: + - app: ollama-scheduler + + spec: + serviceAccountName: ollama-scheduler + containers: + - name: ollama-scheduler + image: docker.io/ion606/ollama-scheduler:0.1.0 + imagePullPolicy: IfNotPresent + + env: + - name: PORT + value: "3000" + - name: NS + value: "argo" + ports: + - name: http + containerPort: 3000 + + readinessProbe: + tcpSocket: + - port: 3000 + initialDelaySeconds: 3 + periodSeconds: 10 + + livenessProbe: + tcpSocket: + - port: 3000 + initialDelaySeconds: 10 + periodSeconds: 20 + + resources: + requests: + - cpu: "50m" + - memory: "64Mi" + limits: + - cpu: "200m" + - memory: "256Mi" --- apiVersion: v1 kind: Service metadata: - name: schedules-api - namespace: argo + name: ollama-scheduler + namespace: argo spec: - selector: { app: schedules-api } - ports: - - { name: http, port: 3000, targetPort: 3000 } - type: ClusterIP + selector: + - app: ollama-scheduler + ports: + - name: http + port: 3000 + targetPort: 3000 + type: ClusterIP diff --git a/manifests/argo-schedules-api/rbac.yaml b/manifests/argo-schedules-api/rbac.yaml index 6f67f9a..eeb17a8 100644 --- a/manifests/argo-schedules-api/rbac.yaml +++ b/manifests/argo-schedules-api/rbac.yaml @@ -1,47 +1,37 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: schedules-api - namespace: argo + name: ollama-scheduler + namespace: argo + --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - name: schedules-api - namespace: argo + name: ollama-scheduler + namespace: argo rules: - - apiGroups: ["argoproj.io"] - resources: ["cronworkflows"] - verbs: ["create","get","list","watch","update","patch","delete"] - - apiGroups: ["argoproj.io"] - resources: ["workflows"] - verbs: ["create","get","list"] - - apiGroups: ["argoproj.io"] - resources: ["workflowtemplates"] - verbs: ["get","list"] ---- -# If you need ClusterWorkflowTemplate support, create this ClusterRole and a ClusterRoleBinding -# with subject serviceAccountName: schedules-api, namespace: argo -# apiVersion: rbac.authorization.k8s.io/v1 -# kind: ClusterRole -# metadata: -# name: schedules-api-cwft-read -# rules: -# - apiGroups: ["argoproj.io"] -# resources: ["clusterworkflowtemplates"] -# verbs: ["get","list"] + - apiGroups: ["argoproj.io"] + resources: ["cronworkflows"] + verbs: ["create", "get", "list", "watch", "update", "patch", "delete"] + - apiGroups: ["argoproj.io"] + resources: ["workflows"] + verbs: ["create", "get", "list"] + - apiGroups: ["argoproj.io"] + resources: ["workflowtemplates"] + verbs: ["get", "list"] + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: schedules-api - namespace: argo -subjects: - - kind: ServiceAccount - name: schedules-api + name: ollama-scheduler namespace: argo +subjects: + - kind: ServiceAccount + name: ollama-scheduler + namespace: argo roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: schedules-api - + apiGroup: rbac.authorization.k8s.io + kind: Role + name: ollama-scheduler diff --git a/scheduler/package.json b/scheduler/package.json index 893873c..d7b2b0e 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -1,14 +1,13 @@ { - "name": "schedules-api", - "version": "0.1.0", - "private": true, - "type": "module", - "scripts": { - "start": "bun run server.mjs", - "dev": "bun run --hot server.mjs" - }, - "dependencies": { - "@kubernetes/client-node": "^0.22.1" - } -} - + "name": "ollama-scheduler", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "start": "bun run server.mjs", + "dev": "bun run --hot server.mjs" + }, + "dependencies": { + "@kubernetes/client-node": "^0.22.1" + } +} \ No newline at end of file