hello/deployment/hello.yaml

76 lines
1.4 KiB
YAML
Raw Normal View History

2024-03-19 14:12:40 +08:00
apiVersion: v1
kind: Namespace
metadata:
name: hello-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: hello-app
name: hello
spec:
replicas: 1
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: system
2024-03-19 15:39:06 +08:00
image: loveuer/hello_app:v2.0.1
2024-03-19 14:12:40 +08:00
imagePullPolicy: IfNotPresent
command: ["/app/hello_app"]
ports:
- containerPort: 80
resources:
limits:
memory: 60Mi
cpu: 1
---
apiVersion: v1
kind: Service
metadata:
namespace: hello-app
name: hello
# annotations:
# metallb.universe.tf/loadBalancerIPs: 10.220.10.48
spec:
selector:
app: hello
# type: LoadBalancer
type: ClusterIP
ports:
- name: hello-http
port: 80
targetPort: 80
# nodePort: 31997
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ing-hello
namespace: hello-app
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /hello/$2
spec:
ingressClassName: nginx
rules:
- host: "hello.zyp.dev.com"
http:
paths:
- path: /hello(/|$)(.*)
pathType: Prefix
backend:
service:
name: hello
port:
number: 80