2025-12-25 15:37:56 +08:00
|
|
|
---
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
2025-12-25 23:57:33 +08:00
|
|
|
labels:
|
|
|
|
|
app: $APP_NAME
|
|
|
|
|
version: $APP_TAG
|
|
|
|
|
name: $APP_NAME
|
|
|
|
|
namespace: default
|
2025-12-25 15:37:56 +08:00
|
|
|
spec:
|
2025-12-25 23:57:33 +08:00
|
|
|
progressDeadlineSeconds: 600
|
|
|
|
|
replicas: 1
|
|
|
|
|
revisionHistoryLimit: 2
|
2025-12-25 15:37:56 +08:00
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
2025-12-25 23:57:33 +08:00
|
|
|
app: $APP_NAME
|
|
|
|
|
strategy:
|
|
|
|
|
rollingUpdate:
|
|
|
|
|
maxSurge: 50%
|
|
|
|
|
maxUnavailable: 50%
|
|
|
|
|
type: RollingUpdate
|
2025-12-25 15:37:56 +08:00
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
2025-12-25 23:57:33 +08:00
|
|
|
app: $APP_NAME
|
|
|
|
|
version: $APP_TAG
|
2025-12-25 15:37:56 +08:00
|
|
|
spec:
|
|
|
|
|
containers:
|
2025-12-26 10:20:13 +08:00
|
|
|
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
|
2025-12-25 23:57:33 +08:00
|
|
|
name: $APP_NAME
|
2025-12-25 15:37:56 +08:00
|
|
|
imagePullPolicy: Always
|
|
|
|
|
readinessProbe:
|
|
|
|
|
httpGet:
|
2025-12-28 17:06:27 +08:00
|
|
|
path: /test
|
2025-12-25 15:37:56 +08:00
|
|
|
port: 9090
|
|
|
|
|
initialDelaySeconds: 1
|
2025-12-25 23:57:33 +08:00
|
|
|
timeoutSeconds: 10
|
|
|
|
|
failureThreshold: 30
|
2025-12-25 15:37:56 +08:00
|
|
|
successThreshold: 5
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: 9090
|
|
|
|
|
imagePullSecrets:
|
|
|
|
|
- name: dockerhub-id
|
|
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
2025-12-25 23:57:33 +08:00
|
|
|
labels:
|
|
|
|
|
app: $APP_NAME
|
|
|
|
|
name: $APP_NAME
|
|
|
|
|
namespace: default
|
2025-12-25 15:37:56 +08:00
|
|
|
spec:
|
|
|
|
|
type: NodePort
|
|
|
|
|
externalTrafficPolicy: Local
|
|
|
|
|
ports:
|
2025-12-25 23:57:33 +08:00
|
|
|
- name: http
|
2025-12-25 15:37:56 +08:00
|
|
|
protocol: TCP
|
|
|
|
|
port: 9090
|
2025-12-26 17:07:01 +08:00
|
|
|
nodePort: 30909
|
2025-12-25 15:37:56 +08:00
|
|
|
selector:
|
2025-12-25 23:57:33 +08:00
|
|
|
app: $APP_NAME
|