diff --git a/Jenkinsfile b/Jenkinsfile index ef975bd..0a61847 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,11 +16,10 @@ node { sh 'argocd app list' // """ } - } - } - - - stage('Create app') { +// } + } + + stage('Create app') { withKubeConfig(credentialsId: 'aws-eksctl-kubeconfig', serverUrl: '') { sh """ argocd app create ${env.BRANCH_NAME}-kustomize-guestbook \ diff --git a/kustomize-guestbook/base/argo-app.yaml b/kustomize-guestbook/base/argo-app.yaml new file mode 100644 index 0000000..03c2886 --- /dev/null +++ b/kustomize-guestbook/base/argo-app.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: guestbook + namespace: argocd + # finalizers: + # - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: kustomize-guestbook + server: https://kubernetes.default.svc + project: default + source: + path: kustomize-guestbook + repoURL: https://github.com/radtac-craft/argocd-example-apps.git + targetRevision: HEAD \ No newline at end of file diff --git a/kustomize-guestbook/base/ingress.yaml b/kustomize-guestbook/base/ingress.yaml index 666c673..75dd755 100644 --- a/kustomize-guestbook/base/ingress.yaml +++ b/kustomize-guestbook/base/ingress.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: kustomize-guestbook-ingress + name: guestbook-ingress # namespace: guestbook labels: app.kubernetes.io/component: server diff --git a/kustomize-guestbook/base/kustomization.yaml b/kustomize-guestbook/base/kustomization.yaml index d22b5c8..1b53f90 100644 --- a/kustomize-guestbook/base/kustomization.yaml +++ b/kustomize-guestbook/base/kustomization.yaml @@ -1,8 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + namePrefix: kustomize- resources: - guestbook-ui-deployment.yaml - guestbook-ui-svc.yaml - ingress.yaml -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization +- argo-app.yaml \ No newline at end of file diff --git a/kustomize-guestbook/overlays/dev/argo-app.yaml b/kustomize-guestbook/overlays/dev/argo-app.yaml new file mode 100644 index 0000000..ba7de0b --- /dev/null +++ b/kustomize-guestbook/overlays/dev/argo-app.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: guestbook + namespace: argocd + # finalizers: + # - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: dev-kustomize-guestbook + server: https://kubernetes.default.svc + project: default + source: + path: kustomize-guestbook/overlays/dev + repoURL: https://github.com/radtac-craft/argocd-example-apps.git + targetRevision: HEAD \ No newline at end of file diff --git a/kustomize-guestbook/overlays/dev/ingress.yaml b/kustomize-guestbook/overlays/dev/ingress.yaml index f747b41..d2a8233 100644 --- a/kustomize-guestbook/overlays/dev/ingress.yaml +++ b/kustomize-guestbook/overlays/dev/ingress.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: kustomize-guestbook-ingress + name: guestbook-ingress namespace: spec: rules: diff --git a/kustomize-guestbook/overlays/dev/kustomization.yaml b/kustomize-guestbook/overlays/dev/kustomization.yaml index 6150327..0fc5da9 100644 --- a/kustomize-guestbook/overlays/dev/kustomization.yaml +++ b/kustomize-guestbook/overlays/dev/kustomization.yaml @@ -2,4 +2,5 @@ bases: - ../../base namePrefix: dev- patchesStrategicMerge: -- ingress.yaml \ No newline at end of file +- ingress.yaml +- argo-app.yaml \ No newline at end of file diff --git a/kustomize-guestbook/overlays/prod/argo-app.yaml b/kustomize-guestbook/overlays/prod/argo-app.yaml new file mode 100644 index 0000000..b2e9228 --- /dev/null +++ b/kustomize-guestbook/overlays/prod/argo-app.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: guestbook + namespace: argocd + # finalizers: + # - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: prod-kustomize-guestbook + server: https://kubernetes.default.svc + project: default + source: + path: kustomize-guestbook/overlays/prod + repoURL: https://github.com/radtac-craft/argocd-example-apps.git + targetRevision: HEAD \ No newline at end of file diff --git a/kustomize-guestbook/overlays/prod/ingress.yaml b/kustomize-guestbook/overlays/prod/ingress.yaml index 8b1c9d7..6e2e86b 100644 --- a/kustomize-guestbook/overlays/prod/ingress.yaml +++ b/kustomize-guestbook/overlays/prod/ingress.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: kustomize-guestbook-ingress + name: guestbook-ingress namespace: spec: rules: diff --git a/kustomize-guestbook/overlays/prod/kustomization.yaml b/kustomize-guestbook/overlays/prod/kustomization.yaml index a9f1d8b..268be52 100644 --- a/kustomize-guestbook/overlays/prod/kustomization.yaml +++ b/kustomize-guestbook/overlays/prod/kustomization.yaml @@ -2,4 +2,5 @@ bases: - ../../base namePrefix: prod- patchesStrategicMerge: -- ingress.yaml \ No newline at end of file +- ingress.yaml +- argo-app.yaml \ No newline at end of file