88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
# Production environment overlay
|
||
# 使用方式: kubectl apply -k manifests/overlays/prod
|
||
|
||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||
kind: Kustomization
|
||
|
||
namespace: nuwax-rcoder-prod
|
||
|
||
resources:
|
||
- ../../base
|
||
# prod 独立的集群级资源(避免与 dev 冲突)
|
||
- juicefs-storageclass.yaml
|
||
- clusterrolebinding.yaml
|
||
# prod 独立的 namespace 内资源
|
||
- rcoder-configmap.yaml
|
||
- credentials.yaml
|
||
- juicefs-secret.yaml
|
||
|
||
# 生产环境标签(含义同 dev 注释)
|
||
labels:
|
||
- pairs:
|
||
environment: production
|
||
includeSelectors: false
|
||
includeTemplates: true
|
||
|
||
# 生产环境副本数
|
||
replicas:
|
||
- name: rcoder
|
||
count: 2
|
||
|
||
# 生产环境镜像 tag
|
||
images:
|
||
- name: nuwax-docker-images-registry.cn-hangzhou.cr.aliyuncs.com/dev/rcoder
|
||
newName: nuwax-docker-images-registry.cn-hangzhou.cr.aliyuncs.com/nuwax-test/rcoder-k8s
|
||
newTag: latest
|
||
- name: nuwax-docker-images-registry.cn-hangzhou.cr.aliyuncs.com/dev/rcoder-agent-runner
|
||
newName: nuwax-docker-images-registry.cn-hangzhou.cr.aliyuncs.com/nuwax-test/rcoder-computer-agent-runner
|
||
newTag: latest
|
||
|
||
patches:
|
||
# NodePort: 30081(prod 专用,与 dev 30080 错开)
|
||
- patch: |-
|
||
apiVersion: v1
|
||
kind: Service
|
||
metadata:
|
||
name: rcoder
|
||
spec:
|
||
ports:
|
||
- port: 8087
|
||
targetPort: 8087
|
||
nodePort: 30081
|
||
target:
|
||
kind: Service
|
||
name: rcoder
|
||
|
||
# PVC 指向 prod 专属 StorageClass
|
||
- patch: |-
|
||
apiVersion: v1
|
||
kind: PersistentVolumeClaim
|
||
metadata:
|
||
name: rcoder-workspace
|
||
spec:
|
||
storageClassName: juicefs-sc-prod
|
||
target:
|
||
kind: PersistentVolumeClaim
|
||
name: rcoder-workspace
|
||
|
||
# rcoder deployment 指向 prod 环境的 namespace 和 StorageClass
|
||
- patch: |-
|
||
apiVersion: apps/v1
|
||
kind: Deployment
|
||
metadata:
|
||
name: rcoder
|
||
spec:
|
||
template:
|
||
spec:
|
||
containers:
|
||
- name: rcoder
|
||
env:
|
||
- name: RCODER_K8S_NAMESPACE
|
||
value: nuwax-rcoder-prod
|
||
- name: RCODER_K8S_STORAGE_CLASS
|
||
value: juicefs-sc-prod
|
||
target:
|
||
kind: Deployment
|
||
name: rcoder
|
||
|