ingress controller for frontend and rest api

This commit is contained in:
Roger 2024-04-21 01:24:28 +00:00
parent a986835e24
commit 5e7340c1fa
6 changed files with 36 additions and 33 deletions

View File

@ -48,6 +48,5 @@ spec:
- protocol: TCP
port: 8000
targetPort: 8000
nodePort: 30003
type: NodePort
type: ClusterIP

View File

@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: frontend
image: oktopusp/frontend:latest
image: rogersacchelli/frontend:1.0.3
resources:
requests:
memory: 64Mi
@ -25,11 +25,11 @@ spec:
memory: 256Mi
cpu: 200m
ports:
- containerPort: 8080
- containerPort: 3000
imagePullPolicy: IfNotPresent
env:
# - name: NEXT_PUBLIC_REST_ENDPOINT
# value: "192.168.1.130:30003"
- name: NEXT_PUBLIC_REST_ENDPOINT
value: "/api"
#- name: NEXT_PUBLIC_WS_ENDPOINT
# value: "192.168.1.130:30005"
---
@ -42,7 +42,7 @@ spec:
app: frontend
ports:
- protocol: TCP
port: 8080
targetPort: 8080
externalTrafficPolicy: Local
type: LoadBalancer
port: 3000
targetPort: 3000
#externalTrafficPolicy: Local
type: ClusterIP

View File

@ -1,7 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: haproxy-controller
data:
syslog-server: "address:stdout, format: raw, facility:daemon"

View File

@ -1,8 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-tcp
namespace: default
data:
1883: # Port where the frontend is going to listen to.
default/mqtt-svc:1883 # Kubernetes service in the format NS/ServiceName:ServicePort

View File

@ -1,8 +0,0 @@
controller:
service:
tcpPorts:
- name: mqtt
port: 1883
targetPort: 1883
extraArgs:
- --configmap-tcp-services=default/haproxy-tcp

View File

@ -0,0 +1,27 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
spec:
ingressClassName: "haproxy"
rules:
- host: oktopus.rdss.cloud
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend-svc
port:
number: 3000
- path: /api
pathType: Prefix
backend:
service:
name: controller-svc
port:
number: 8000