Skip to content

Commit 84f6e1a

Browse files
committed
deploy: add deployment yaml
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent d839cfd commit 84f6e1a

10 files changed

+140
-0
lines changed

deploy/base/deployment.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: connect-python
5+
spec:
6+
progressDeadlineSeconds: 600
7+
selector:
8+
matchLabels:
9+
app: connect-python
10+
strategy:
11+
rollingUpdate:
12+
maxSurge: 25%
13+
maxUnavailable: 25%
14+
type: RollingUpdate
15+
template:
16+
metadata:
17+
labels:
18+
app: connect-python
19+
spec:
20+
containers:
21+
- name: connect-python
22+
command:
23+
- "uv"
24+
- "run"
25+
- "hypercorn"
26+
- "main:app"
27+
- "--bind"
28+
- "0.0.0.0"
29+
imagePullPolicy: Always
30+
ports:
31+
- containerPort: 8000
32+
name: http2
33+
protocol: TCP
34+
resources:
35+
limits:
36+
cpu: "1"
37+
memory: 512Mi
38+
requests:
39+
cpu: 800m
40+
memory: 400Mi
41+
terminationMessagePath: /dev/termination-log
42+
terminationMessagePolicy: File
43+
dnsPolicy: ClusterFirst
44+
restartPolicy: Always
45+
schedulerName: default-scheduler
46+
serviceAccountName: connect-python
47+
terminationGracePeriodSeconds: 30
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: connect-python
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: connect-python
10+
minReplicas: 1
11+
maxReplicas: 2
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
target:
17+
type: Utilization
18+
averageUtilization: 60

deploy/base/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: connect-python
5+
6+
resources:
7+
- deployment.yaml
8+
- horizontal_pod_autoscaler.yaml
9+
- namespace.yaml
10+
- service_account.yaml
11+
- service.yaml

deploy/base/namespace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: connect-python

deploy/base/service.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: connect-python
5+
spec:
6+
ports:
7+
- name: http2
8+
port: 8000
9+
protocol: TCP
10+
selector:
11+
app: connect-python
12+
type: ClusterIP

deploy/base/service_account.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: connect-python

deploy/dev/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: connect-python
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: connect-python
10+
image: asia-northeast1-docker.pkg.dev/gaudiy-containers/connect/connect-python
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: connect-python
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: connect-python
10+
minReplicas: 1
11+
maxReplicas: 2
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
target:
17+
type: Utilization
18+
averageUtilization: 60

deploy/dev/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: connect-python
4+
resources:
5+
- ../base
6+
patches:
7+
- path: deployment.yaml
8+
- path: horizontal_pod_autoscaler.yaml
9+
- path: service_account.yaml
10+
images:
11+
- name: asia-northeast1-docker.pkg.dev/gaudiy-containers/connect/connect-python
12+
newTag: latest

deploy/dev/service_account.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: connect-python

0 commit comments

Comments
 (0)