apiVersion: v1
kind: Service
metadata:
  name: ollama-external
  namespace: default
spec:
  ports:
    - port: 3000
      targetPort: 3000
---
apiVersion: v1
kind: Endpoints
metadata:
  name: ollama-external
  namespace: default
subsets:
  - addresses:
      - ip: 192.168.50.100
    ports:
      - port: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ollama
  namespace: default
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
spec:
  ingressClassName: traefik
  tls:
    - hosts:
        - ai.roysland.net
      secretName: ollama-tls
  rules:
    - host: ai.roysland.net
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: ollama-external
                port:
                  number: 3000
