Skip to content

Commit

Permalink
Added CRDs to Flux GitOps.
Browse files Browse the repository at this point in the history
  • Loading branch information
lreimer committed Dec 2, 2024
1 parent ee18b23 commit 21e0537
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions infrastructure/cluster/flux-system/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ resources:
- gotk-components.yaml
- gotk-sync.yaml
- platform.yaml
- services.yaml
14 changes: 14 additions & 0 deletions infrastructure/cluster/flux-system/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: services
namespace: flux-system
spec:
interval: 10m0s
path: ./infrastructure/services
prune: true
dependsOn:
- name: platform
sourceRef:
kind: GitRepository
name: flux-system
55 changes: 55 additions & 0 deletions infrastructure/services/openai-chat-service/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: openai-chat-service
namespace: default
labels:
app: openai-chat-service
spec:
replicas: 2
selector:
matchLabels:
app: openai-chat-service
template:
metadata:
labels:
app: openai-chat-service
spec:
containers:
- name: openai-chat-service
image: ghcr.io/lreimer/k8s-native-java-ai-openai-chat-service:main
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
- name: management
containerPort: 9000
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
probes:
readinessProbe:
httpGet:
path: /q/health/ready
port: management
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /q/health/live
port: management
initialDelaySeconds: 10
periodSeconds: 10
env:
- name: QUARKUS_LANGCHAIN4J_OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: openai-api-key
key: OPENAI_API_KEY
# - name: QUARKUS_LANGCHAIN4J_OPENAI_BASE_URL
# value: "http://openai-proxy-service.default.svc.cluster.local:10000"

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
13 changes: 13 additions & 0 deletions infrastructure/services/openai-chat-service/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: openai-chat-service
namespace: default
spec:
selector:
app: openai-chat-service
ports:
- protocol: TCP
port: 8080
targetPort: http
type: LoadBalancer

0 comments on commit 21e0537

Please sign in to comment.