diff --git a/application.yaml b/application.yaml new file mode 100644 index 0000000..5249819 --- /dev/null +++ b/application.yaml @@ -0,0 +1,23 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: myapp-argo-application + namespace: argocd +spec: + project: default + + source: + repoURL: https://github.com/yangchuansheng/argocd-lab.git + targetRevision: HEAD + path: dev + destination: + server: https://kubernetes.default.svc + namespace: myapp + + syncPolicy: + syncOptions: + - CreateNamespace=true + + automated: + selfHeal: true + prune: true diff --git a/dev/deployment.yaml b/dev/deployment.yaml new file mode 100644 index 0000000..902c642 --- /dev/null +++ b/dev/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myapp +spec: + selector: + matchLabels: + app: myapp + replicas: 2 + template: + metadata: + labels: + app: myapp + spec: + containers: + - name: myapp + image: nginx:latest + ports: + - containerPort: 80 diff --git a/dev/service.yaml b/dev/service.yaml new file mode 100644 index 0000000..686d986 --- /dev/null +++ b/dev/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: myapp-service +spec: + selector: + app: myapp + ports: + - port: 80 + protocol: TCP + targetPort: 80