expose ollama via nodeport instead
This commit is contained in:
parent
864c871c87
commit
f7f3daac80
|
@ -1,26 +1,7 @@
|
|||
resources:
|
||||
- ollama-deployment.yaml
|
||||
- ollama-ingress.yaml
|
||||
|
||||
namePrefix: ollama-
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/name: ollama
|
||||
|
||||
configMapGenerator:
|
||||
- name: kustomize-generated-config
|
||||
literals:
|
||||
- OLLAMA_EXTERNAL_HOST=ollama.badjware.dev
|
||||
- OLLAMA_EXTERNAL_URL=http://ollama.badjware.dev
|
||||
|
||||
replacements:
|
||||
- source:
|
||||
kind: ConfigMap
|
||||
name: kustomize-generated-config
|
||||
fieldPath: data.OLLAMA_EXTERNAL_HOST
|
||||
targets:
|
||||
- select:
|
||||
kind: Ingress
|
||||
name: server
|
||||
fieldPaths:
|
||||
- spec.rules.0.host
|
||||
|
|
|
@ -46,8 +46,9 @@ spec:
|
|||
cpu: 3000m
|
||||
nvidia.com/gpu: 1
|
||||
ports:
|
||||
- containerPort: 11434
|
||||
name: http
|
||||
- name: http
|
||||
hostPort: 11434
|
||||
containerPort: 11434
|
||||
volumeMounts:
|
||||
- name: server-data
|
||||
mountPath: /root/.ollama
|
||||
|
@ -76,4 +77,19 @@ spec:
|
|||
ports:
|
||||
- name: http
|
||||
port: 11434
|
||||
targetPort: http
|
||||
targetPort: http
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nodeport
|
||||
labels:
|
||||
app.kubernetes.io/component: nodeport
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app.kubernetes.io/component: server
|
||||
ports:
|
||||
- targetPort: http
|
||||
port: 11434
|
||||
nodePort: 31002
|
|
@ -1,19 +0,0 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: server
|
||||
labels:
|
||||
app.kubernetes.io/name: ollama
|
||||
probe: blackbox-http
|
||||
spec:
|
||||
rules:
|
||||
- host: ${OLLAMA_EXTERNAL_HOST}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: server
|
||||
port:
|
||||
name: http
|
Loading…
Reference in New Issue