try nodeport with kind again

This commit is contained in:
Waylon Walker 2024-03-13 19:13:04 -05:00
parent a0c2582f82
commit fd473a04f2
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -79,6 +79,7 @@ spec:
port: 5000 port: 5000
targetPort: 5000 targetPort: 5000
# blue-green deployment replaces traditional deployment
# --- # ---
# #
# apiVersion: apps/v1 # apiVersion: apps/v1
@ -104,70 +105,74 @@ spec:
# ports: # ports:
# - containerPort: 5000 # - containerPort: 5000
# #
# outside of kind you might prefer ingress
# ---
#
# 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: {}
#
# inside of kind nodeport service is easier to test
--- ---
apiVersion: networking.k8s.io/v1 apiVersion: v1
kind: Ingress kind: Service
metadata: metadata:
labels: name: hello-world-active
service: hello-world
name: hello-world-ingress
namespace: hello-world namespace: hello-world
spec: spec:
rules: type: NodePort # Change service type to NodePort
- http: ports:
paths: - name: "5000"
- backend: port: 5000
service: targetPort: 5000
name: hello-world-active nodePort: 30001 # Specify a node port (you can choose any available port)
port: selector:
number: 5000 app: rollout-bluegreen
path: /active
pathType: Prefix
- http: ---
paths: apiVersion: v1
- backend: kind: Service
service: metadata:
name: hello-world-preview name: hello-world-preview
port: namespace: hello-world
number: 5000 spec:
path: /preview type: NodePort # Change service type to NodePort
pathType: Prefix ports:
status: - name: "5000"
loadBalancer: {} port: 5000
targetPort: 5000
nodePort: 30002 # Specify a different node port (make sure it's available)
selector:
# --- app: rollout-bluegreen
#
# apiVersion: v1
# kind: Service
# metadata:
# name: hello-world-active
# namespace: hello-world
# spec:
# 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: rollout-bluegreen
#
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: hello-world-preview
# 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: rollout-bluegreen