Add the external-svc app and deploy it to proxy tdc-aren that is running outide of the k8s cluster - Part deux

This commit is contained in:
douzeb 2022-12-22 19:56:50 +01:00
parent fbda28f48a
commit eb7b8e9da8
5 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,2 @@
resources:
- proxy-service.yaml

View file

@ -0,0 +1,58 @@
---
apiVersion: v1
kind: Service
metadata:
name: external-svc
namespace: infra
spec:
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: external-svc-1 # by convention, use the name of the Service
# as a prefix for the name of the EndpointSlice
namespace: infra
labels:
# You should set the "kubernetes.io/service-name" label.
# Set its value to match the name of the Service
kubernetes.io/service-name: external-svc
endpointslice.kubernetes.io/managed-by: gitops
addressType: IPv4
ports:
- name: ''
appProtocol: http
protocol: TCP
port: 80
endpoints:
- addresses:
- "10.1.2.3"
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: external-svc
namespace: infra
annotations:
kubernetes.io/ingress.class: "nginx"
#cert-manager.io/issuer: "letsencrypt-staging"
spec:
tls:
- hosts:
- my-svc.example.com
secretName: ts-my-app
rules:
- host: my-svc.example.com
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: external-svc
port:
number: 80

View file

@ -0,0 +1,24 @@
---
apiVersion: v1
kind: Service
metadata:
name: external-svc
namespace: infra
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: external-svc-1
namespace: infra
labels:
kubernetes.io/service-name: tdc-aren-external-svc # Is there a way to have the `tdc-aren-` prefix automatically applied here?
ports:
- port: 8080
endpoints:
- addresses:
- "10.10.10.11"

View file

@ -0,0 +1,24 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: external-svc
namespace: infra
annotations:
cert-manager.io/issuer: "letsencrypt-staging"
spec:
tls:
- hosts:
- debats.terre-de-convergence.org
secretName: ts-tdc-aren
rules:
- host: debats.terre-de-convergence.org
http: # Is there a way take this part form the base overlay?
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: tdc-aren-external-svc # Is there a way to have the `tdc-aren-` prefix applied automatically?
port:
number: 80

View file

@ -0,0 +1,6 @@
bases:
- ../base/
namePrefix: tdc-aren-
patchesStrategicMerge:
- ingress.yaml
- backend.yaml