try nodeport

This commit is contained in:
Waylon Walker 2024-03-12 20:27:37 -05:00
parent 8b070fe684
commit 74205f5eb7
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -97,35 +97,70 @@ spec:
# ports:
# - containerPort: 5000
# ---
#
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# labels:
# service: hello-world
# name: hello-world-ingress
# namespace: hello-world
# spec:
# rules:
# - http:
# paths:
# - backend:
# service:
# name: hello-world-active
# port:
# number: 5000
# path: /active
# pathType: Prefix
#
# - http:
# paths:
# - backend:
# service:
# name: hello-world-preview
# port:
# number: 5000
# path: /preview
# pathType: Prefix
# status:
# loadBalancer: {}
#
#
#
---
apiVersion: networking.k8s.io/v1
kind: Ingress
apiVersion: v1
kind: Service
metadata:
labels:
service: hello-world
name: hello-world-ingress
name: hello-world-active
namespace: hello-world
spec:
rules:
- http:
paths:
- backend:
service:
name: hello-world-active
port:
number: 5000
path: /active
pathType: Prefix
type: NodePort # Change service type to NodePort
ports:
- name: "5000"
port: 5000
targetPort: 5000
nodePort: 30001 # Specify a node port (you can choose any available port)
selector:
app: hello-world
- http:
paths:
- backend:
service:
---
apiVersion: v1
kind: Service
metadata:
name: hello-world-preview
port:
number: 5000
path: /preview
pathType: Prefix
status:
loadBalancer: {}
namespace: hello-world
spec:
type: NodePort # Change service type to NodePort
ports:
- name: "5000"
port: 5000
targetPort: 5000
nodePort: 30002 # Specify a different node port (make sure it's available)
selector:
app: hello-world