提交 fdb72674 作者: 余乾开

feat(argocd):补充argocd配置

上级 130e1833
......@@ -31,3 +31,4 @@ build/
### VS Code ###
.vscode/
.idea/
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: pms-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: pms
template:
metadata:
labels:
app: pms
spec:
containers:
- name: pms
image: registry.cn-shanghai.aliyuncs.com/public-namespace/myapp:v1
resources:
limits:
memory: 256Mi
cpu: 100m
ports:
- containerPort: 80
# env:
# - name: SPRING_PROFILES_ACTIVE
# valueFrom:
# configMapKeyRef:
# name: pms-map
# key: SPRING_PROFILES_ACTIVE
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: pms-svc
namespace: default
spec:
selector:
app: pms
type: LoadBalancer #NodePort
ports:
- protocol: TCP
port: 30080
targetPort: 80
\ No newline at end of file
# application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: pms-application
namespace: argocd
spec:
project: default
source:
repoURL: http://git.mmcuav.cn/iuav/pms.git
targetRevision: HEAD #develop master
path: argocd
destination:
server: https://kubernetes.default.svc
namespace: develop
# 默认情况下每 3 分钟会检测 Git 仓库一次
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
prune: true
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-ingress
namespace: argocd
spec:
ingressClassName: nginx-example
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
number: 80
\ No newline at end of file
apiVersion: v1
kind: ConfigMap
metadata:
name: pms-map
namespace: default
data:
SPRING_PROFILES_ACTIVE: default
apiVersion: apps/v1
kind: Deployment
metadata:
name: pms-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: pms
template:
metadata:
labels:
app: pms
spec:
containers:
- name: pms
image: REGISTRY/NAMESPACE/IMAGE:TAG
resources:
limits:
memory: 256Mi
cpu: 100m
ports:
- containerPort: 8081
env:
- name: SPRING_PROFILES_ACTIVE
valueFrom:
configMapKeyRef:
name: pms-map
key: SPRING_PROFILES_ACTIVE
\ No newline at end of file
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pms-ingress
namespace: default
spec:
rules:
- host: infra.mmcuav.cn
http:
paths:
- backend:
serviceName: pms-svc
servicePort: 8081
path: /
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pms
resources:
- ./deployment.yaml
- ./service.yaml
- ./configMap.yaml
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: pms-svc
namespace: default
spec:
selector:
app: pms
type: LoadBalancer #NodePort
ports:
- protocol: TCP
port: 8081
targetPort: 8081
\ No newline at end of file
apiVersion: v1
kind: ConfigMap
metadata:
name: pms-map
data:
SPRING_PROFILES_ACTIVE: dev
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: pms-deployment
spec:
replicas: 1
\ No newline at end of file
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pms-ingress
spec:
rules:
- host: hello-dev.coolops.cn
http:
paths:
- backend:
serviceName: pms-svc
servicePort: 8081
path: /
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namePrefix: dev-
namespace: dev
commonLabels:
variant: dev
commonAnnotations:
note: This is dev!
patchesStrategicMerge:
- configMap.yaml
- deployment.yaml
# - ingress.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: pms-map
data:
SPRING_PROFILES_ACTIVE: prod
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: pms-deployment
spec:
replicas: 1
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
namespace: prod
namePrefix: prod-
commonLabels:
variant: prod
commonAnnotations:
note: This is prod!
patchesStrategicMerge:
- configMap.yaml
- deployment.yaml
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论