use k8s as ingress for external cluster services

This commit is contained in:
Ibrahim Mkusa 2025-06-08 21:29:06 -04:00
parent a371e3d9cd
commit 2cb1b29aa7
2 changed files with 66 additions and 0 deletions

View File

@ -1 +1,4 @@
make sure `nfs-common` package is installed on all nodes
You can also use the ingress-nginx controller to point to external resources
outside the cluster like a vm running 'jellyfin'

View File

@ -0,0 +1,63 @@
# see https://stackoverflow.com/questions/57764237/kubernetes-ingress-to-external-service
---
apiVersion: v1
kind: Namespace
metadata:
name: jellyfin
spec: {}
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: external-ip
namespace: jellyfin
annotations:
external-dns.alpha.kubernetes.io/hostname: jellyfin.homelab.local
spec:
type: LoadBalancer
loadBalancerIP: 192.168.0.251
ports:
- name: app
port: 80
protocol: TCP
targetPort: 8096
---
apiVersion: v1
kind: Endpoints
metadata:
name: external-ip
namespace: jellyfin
subsets:
- addresses:
- ip: 192.168.0.104
ports:
- name: app
port: 8096
protocol: TCP
---
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
#name: external-service
#namespace: jellyfin
#annotations:
#cert-manager.io/cluster-issuer: "letsencrypt-staging"
#spec:
#ingressClassName: nginx
#rules:
#- host: jellyfin.kwerezigua.org
#http:
#paths:
#- backend:
#service:
#name: external-ip
#port:
#number: 80
#path: /
#pathType: Prefix
#tls:
#- hosts:
#- jellyfin.kwerezigua.org
#secretName: jellyfin-ca-secret