adding kustomization
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: schedules-api
|
||||
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" }
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: schedules-api
|
||||
namespace: argo
|
||||
spec:
|
||||
selector: { app: schedules-api }
|
||||
ports:
|
||||
- { name: http, port: 3000, targetPort: 3000 }
|
||||
type: ClusterIP
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: schedules-api
|
||||
namespace: argo
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: schedules-api
|
||||
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"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: schedules-api
|
||||
namespace: argo
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: schedules-api
|
||||
namespace: argo
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: schedules-api
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: WorkflowTemplate
|
||||
metadata:
|
||||
name: hello-template
|
||||
namespace: argo
|
||||
spec:
|
||||
entrypoint: run
|
||||
arguments:
|
||||
parameters:
|
||||
- { name: message, value: "hello from argo" }
|
||||
templates:
|
||||
- name: run
|
||||
container:
|
||||
image: alpine:3.19
|
||||
command: ["/bin/sh","-lc"]
|
||||
args: ["echo \"{{workflow.parameters.message}}\""]
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: WorkflowTemplate
|
||||
metadata:
|
||||
name: ollama-job-template
|
||||
namespace: argo
|
||||
spec:
|
||||
entrypoint: run
|
||||
arguments:
|
||||
parameters:
|
||||
- { name: task, value: "quick-check" }
|
||||
- { name: prompt, value: "reindex embeddings" }
|
||||
templates:
|
||||
- name: run
|
||||
container:
|
||||
# Replace with an image that can reach your Ollama endpoint
|
||||
image: curlimages/curl:8.9.0
|
||||
command: ["/bin/sh","-lc"]
|
||||
args:
|
||||
- >-
|
||||
echo "task: {{workflow.parameters.task}}";
|
||||
echo "prompt: {{workflow.parameters.prompt}}";
|
||||
# Example call (adjust host/port or service DNS):
|
||||
# curl -s http://ollama.ai.svc.cluster.local:11434/api/generate \
|
||||
# -H 'content-type: application/json' \
|
||||
# -d '{"model":"llama3.1","prompt":"{{workflow.parameters.prompt}}"}' | tee /tmp/out.json;
|
||||
echo done.
|
||||
|
||||
Reference in New Issue
Block a user