| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- apiVersion: v1
- kind: Namespace
- metadata:
- name: nginx-app
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: nginx-deployment
- namespace: nginx-app
- labels:
- app: nginx
- spec:
- replicas: 3
- selector:
- matchLabels:
- app: nginx
- template:
- metadata:
- labels:
- app: nginx
- spec:
- containers:
- - name: nginx
- image: registry.cn-hangzhou.aliyuncs.com/zhongpengqun/wanderer:linux-amd64-nginx-stable-alpine-3.23
- ports:
- - containerPort: 80
- resources:
- requests:
- memory: "64Mi"
- cpu: "250m"
- limits:
- memory: "128Mi"
- cpu: "500m"
- readinessProbe:
- httpGet:
- path: /
- port: 80
- initialDelaySeconds: 5
- periodSeconds: 5
- livenessProbe:
- httpGet:
- path: /
- port: 80
- initialDelaySeconds: 10
- periodSeconds: 10
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: nginx-service
- namespace: nginx-app
- labels:
- app: nginx
- spec:
- selector:
- app: nginx
- ports:
- - protocol: TCP
- port: 80
- targetPort: 80
- type: ClusterIP
- ---
- apiVersion: networking.k8s.io/v1
- kind: Ingress
- metadata:
- name: nginx-ingress
- namespace: nginx-app
- spec:
- ingressClassName: traefik # Using traefik which is typically available in k3s
- rules:
- - host: 215.9981.tech
- http:
- paths:
- - path: /
- pathType: Prefix
- backend:
- service:
- name: nginx-service
- port:
- number: 80
|