Skip to content

Commit

Permalink
Deploy with kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggerwang committed Apr 11, 2024
1 parent dcc7d9f commit 6fff3d9
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 142 deletions.
24 changes: 24 additions & 0 deletions .ops/deploy/base/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- image-object-detection.yml

labels:
- pairs:
app.kubernetes.io/name: xtreme1
app.kubernetes.io/instance: xtreme1
includeSelectors: true
# Kubectl v1.24 不支持,默认为 True
# includeTemplates: true

images:
- name: image-object-detection
newName: $IMAGE_NAME
# 使用引号防止全数字情况下被当做数字而不是字符串
newTag: "$IMAGE_TAG"

patches:
- path: patch/deployment-common.yml
target:
kind: Deployment
44 changes: 44 additions & 0 deletions .ops/deploy/base/point-cloud-object-detection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: point-cloud-object-detection
labels:
app.kubernetes.io/component: point-cloud-object-detection
spec:
selector:
matchLabels:
app.kubernetes.io/component: point-cloud-object-detection
template:
metadata:
labels:
app.kubernetes.io/component: point-cloud-object-detection
spec:
containers:
- name: point-cloud-object-detection
image: point-cloud-object-detection
resources:
requests:
memory: 400Mi
cpu: 100m
nvidia.com/gpu: '1'
limits:
memory: 4Gi
cpu: "1"
nvidia.com/gpu: '1'
ports:
- name: http
containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: point-cloud-object-detection
labels:
app.kubernetes.io/component: point-cloud-object-detection
spec:
selector:
app.kubernetes.io/component: point-cloud-object-detection
ports:
- name: http
port: 80
targetPort: 5000
5 changes: 5 additions & 0 deletions .ops/deploy/dev/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../base
5 changes: 5 additions & 0 deletions .ops/deploy/test/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../base
71 changes: 0 additions & 71 deletions .ops/dev/deployment.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .ops/test/deployment.yml

This file was deleted.

0 comments on commit 6fff3d9

Please sign in to comment.