Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: sync from demo app #284

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/**/charts/
59 changes: 45 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,48 @@ This repository contains example applications for demoing ArgoCD functionality.
to register this repository to your ArgoCD instance, or fork this repo and push your own commits
to explore ArgoCD and GitOps!

| Application | Description |
|-------------|-------------|
| [guestbook](guestbook/) | A hello word guestbook app as plain YAML |
| [helm-guestbook](helm-guestbook/) | The guestbook app as a Helm chart |
| [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook app as a raw jsonnet |
| [jsonnet-guestbook-tla](jsonnet-guestbook-tla/) | The guestbook app as a raw jsonnet with support for top level arguments |
| [kustomize-guestbook](kustomize-guestbook/) | The guestbook app as a Kustomize 2 app |
| [pre-post-sync](pre-post-sync/) | Demonstrates Argo CD PreSync and PostSync hooks |
| [sync-waves](sync-waves/) | Demonstrates Argo CD sync waves with hooks |
| [helm-dependency](helm-dependency/) | Demonstrates how to customize an OTS (off-the-shelf) helm chart from an upstream repo |
| [sock-shop](sock-shop/) | A microservices demo app (https://microservices-demo.github.io) |
| [plugins](plugins/) | Apps which demonstrate config management plugins usage |
| [blue-green](blue-green/) | Demonstrates how to implement blue-green deployment using [Argo Rollouts](https://github.com/argoproj/argo-rollouts)
| [apps](apps/) | An app composed of other apps |
| Status | Application | Description |
| ------------------------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [![App Status][badge_sync_example_apps]][app_sync_example_apps] | [apps](apps/) | An app composed of other apps synchronized in [cd.apps.argoproj.io][app_sync_example_apps] |
| [![App Status][badge_blue_green]][app_blue_green] | [blue-green](blue-green/) | Demonstrates how to implement blue-green deployment using [Argo Rollouts](https://github.com/argoproj/argo-rollouts) |
| [![App Status][badge_guestbook]][app_guestbook] | [guestbook](guestbook/) | A hello word guestbook app as plain YAML |
| [![App Status][badge_helm_dependency]][app_helm_dependency] | [helm-dependency](helm-dependency/) | Demonstrates how to customize an OTS (off-the-shelf) helm chart from an upstream repo |
| [![App Status][badge_helm_guestbook]][app_helm_guestbook] | [helm-guestbook](helm-guestbook/) | The guestbook app as a Helm chart |
| [![App Status][badge_helm_hooks]][app_helm_hooks] | [helm-hooks](helm-hooks/) | An application with native Helm hooks |
| [![App Status][badge_jsonnet_guestbook]][app_jsonnet_guestbook] | [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook app as a raw jsonnet |
| [![App Status][badge_jsonnet_guestbook_tla]][app_jsonnet_guestbook_tla] | [jsonnet-guestbook-tla](jsonnet-guestbook-tla/) | The guestbook app as a raw jsonnet with support for top level arguments |
| [![App Status][badge_kustomize_guestbook]][app_kustomize_guestbook] | [kustomize-guestbook](kustomize-guestbook/) | The guestbook app as a Kustomize app |
| [![App Status][badge_plugin_kasane]][app_plugin_kasane] | [plugins/kasane](plugins/kasane) | Apps which demonstrate config management plugins usage with [kasane](plugins/kasane/README.md) |
| [![App Status][badge_plugin_kustomized_helm]][app_plugin_kustomized_helm] | [plugins/kustomized-helm](plugins/kustomized-helm) | Apps which demonstrate config management plugins usage with a [kustomized helm chart](plugins/kustomized-helm/README.md) |
| [![App Status][badge_pre_post_sync]][app_pre_post_sync] | [pre-post-sync](pre-post-sync/) | Demonstrates Argo CD PreSync and PostSync hooks |
| [![App Status][badge_sock_shop]][app_sock_shop] | [sock-shop](sock-shop/) | A microservices demo app (https://microservices-demo.github.io) |
| [![App Status][badge_sync_waves]][app_sync_waves] | [sync-waves](sync-waves/) | Demonstrates Argo CD sync waves with hooks |

[app_sync_example_apps]: https://cd.apps.argoproj.io/applications/sync-example-apps
[badge_sync_example_apps]: https://cd.apps.argoproj.io/api/badge?revision=true&name=sync-example-apps
[app_blue_green]: https://cd.apps.argoproj.io/applications/example.blue-green
[badge_blue_green]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.blue-green
[app_guestbook]: https://cd.apps.argoproj.io/applications/example.guestbook
[badge_guestbook]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.guestbook
[app_helm_dependency]: https://cd.apps.argoproj.io/applications/example.helm-dependency
[badge_helm_dependency]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.helm-dependency
[app_helm_guestbook]: https://cd.apps.argoproj.io/applications/example.helm-guestbook
[badge_helm_guestbook]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.helm-guestbook
[app_helm_hooks]: https://cd.apps.argoproj.io/applications/example.helm-hooks
[badge_helm_hooks]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.helm-hooks
[app_jsonnet_guestbook]: https://cd.apps.argoproj.io/applications/example.jsonnet-guestbook
[badge_jsonnet_guestbook]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.jsonnet-guestbook
[app_jsonnet_guestbook_tla]: https://cd.apps.argoproj.io/applications/example.jsonnet-guestbook-tla
[badge_jsonnet_guestbook_tla]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.jsonnet-guestbook-tla
[app_kustomize_guestbook]: https://cd.apps.argoproj.io/applications/example.kustomize-guestbook
[badge_kustomize_guestbook]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.kustomize-guestbook
[app_plugin_kasane]: https://cd.apps.argoproj.io/applications/example.plugin-kasane
[badge_plugin_kasane]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.plugin-kasane
[app_plugin_kustomized_helm]: https://cd.apps.argoproj.io/applications/example.plugin-kustomized-helm
[badge_plugin_kustomized_helm]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.plugin-kustomized-helm
[app_pre_post_sync]: https://cd.apps.argoproj.io/applications/example.pre-post-sync
[badge_pre_post_sync]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.pre-post-sync
[app_sock_shop]: https://cd.apps.argoproj.io/applications/example.sock-shop
[badge_sock_shop]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.sock-shop
[app_sync_waves]: https://cd.apps.argoproj.io/applications/example.sync-waves
[badge_sync_waves]: https://cd.apps.argoproj.io/api/badge?revision=true&name=example.sync-waves
29 changes: 29 additions & 0 deletions apps/templates/applications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- range .Values.applications }}
{{- $config := $.Values.config -}}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ printf "example.%s" .name | quote }}
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: {{ .namespace | default .name | quote }}
server: {{ $config.spec.destination.server | quote }}
project: default
source:
path: {{ .path | default .name | quote }}
repoURL: {{ $config.spec.source.repoURL }}
targetRevision: {{ $config.spec.source.targetRevision }}
{{- with .tool }}
{{- . | toYaml | nindent 4 }}
{{- end }}
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true
---
{{ end -}}
16 changes: 0 additions & 16 deletions apps/templates/helm-guestbook.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions apps/templates/helm-hooks.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions apps/templates/kustomize-guestbook.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions apps/templates/namespaces.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions apps/templates/sync-waves.yaml

This file was deleted.

50 changes: 44 additions & 6 deletions apps/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
spec:
destination:
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: HEAD
config:
spec:
destination:
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/agaudreault/argocd-example-apps
targetRevision: sync-from-demo

applications:
- name: blue-green
tool:
helm:
releaseName: blue-green
- name: guestbook
- name: helm-dependency
tool:
helm:
releaseName: helm-dependency
- name: helm-guestbook
tool:
helm:
releaseName: helm-guestbook
- name: helm-hooks
- name: jsonnet-guestbook
- name: jsonnet-guestbook-tla
- name: kustomize-guestbook
- name: plugin-kasane
path: plugins/kasane
tool:
plugin:
name: kasane
- name: plugin-kustomized-helm
path: plugins/kustomized-helm
tool:
plugin:
name: kustomized-helm
- name: plugin-nix
path: plugins/nix
tool:
plugin:
name: nix
- name: pre-post-sync
- name: sock-shop
- name: sync-waves
2 changes: 2 additions & 0 deletions helm-dependency/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
wordpress:
image:
tag: invalid #break this app on purpose until a dedicated broken app is created
wordpressPassword: foo
mariadb:
db:
Expand Down
10 changes: 5 additions & 5 deletions plugins/nix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ repoServer:
# the init container copies the whole nix store and profiles into the
# temporary volume and makes sure the permissions are correct
command:
- "sh"
- "-c"
- "cp -a /nix/* /nixvol && chown -R 999 /nixvol/*"
- 'sh'
- '-c'
- 'cp -a /nix/* /nixvol && chown -R 999 /nixvol/*'
image: nixos/nix:latest
# the image will always be updated at init step, so the one in the
# extraContainers must have the policy of Never to always be the same
# exact image.
imagePullPolicy: Always
imagePullPolicy: Always
volumeMounts:
- mountPath: /nixvol
name: nix-cmp-nix
Expand Down Expand Up @@ -123,7 +123,7 @@ data:
fi
nix build $IMPURE_FLAG ".#${OUTPUT}"
lockRepo: true
name: nix-cmp-plugin
name: nix
version: v1.0
```

Expand Down
23 changes: 23 additions & 0 deletions sock-shop/base/front-end-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: front-end-ingress
labels:
name: front-end
annotations:
ingress.kubernetes.io/proxy-body-size: 100M
ingress.kubernetes.io/app-root: '/'
spec:
ingressClassName: nginx
rules:
- host: sockshop.apps.argoproj.io
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: front-end
port:
number: 80
7 changes: 3 additions & 4 deletions sock-shop/base/front-end-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ metadata:
labels:
name: front-end
spec:
type: LoadBalancer
type: ClusterIP
ports:
- port: 80
targetPort: 8079
nodePort: 30001
- port: 80
targetPort: 8079
selector:
name: front-end
57 changes: 29 additions & 28 deletions sock-shop/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
resources:
- base/carts-db-dep.yaml
- base/carts-db-svc.yaml
- base/carts-dep.yaml
- base/carts-svc.yaml
- base/catalogue-db-dep.yaml
- base/catalogue-db-svc.yaml
- base/catalogue-dep.yaml
- base/catalogue-svc.yaml
- base/front-end-dep.yaml
- base/front-end-svc.yaml
- base/orders-db-dep.yaml
- base/orders-db-svc.yaml
- base/orders-dep.yaml
- base/orders-svc.yaml
- base/payment-dep.yaml
- base/payment-svc.yaml
- base/queue-master-dep.yaml
- base/queue-master-svc.yaml
- base/rabbitmq-dep.yaml
- base/rabbitmq-svc.yaml
- base/session-db-dep.yaml
- base/session-db-svc.yaml
- base/shipping-dep.yaml
- base/shipping-svc.yaml
- base/user-db-dep.yaml
- base/user-db-svc.yaml
- base/user-dep.yaml
- base/user-svc.yaml
- base/carts-db-dep.yaml
- base/carts-db-svc.yaml
- base/carts-dep.yaml
- base/carts-svc.yaml
- base/catalogue-db-dep.yaml
- base/catalogue-db-svc.yaml
- base/catalogue-dep.yaml
- base/catalogue-svc.yaml
- base/front-end-dep.yaml
- base/front-end-ingress.yaml
- base/front-end-svc.yaml
- base/orders-db-dep.yaml
- base/orders-db-svc.yaml
- base/orders-dep.yaml
- base/orders-svc.yaml
- base/payment-dep.yaml
- base/payment-svc.yaml
- base/queue-master-dep.yaml
- base/queue-master-svc.yaml
- base/rabbitmq-dep.yaml
- base/rabbitmq-svc.yaml
- base/session-db-dep.yaml
- base/session-db-svc.yaml
- base/shipping-dep.yaml
- base/shipping-svc.yaml
- base/user-db-dep.yaml
- base/user-db-svc.yaml
- base/user-dep.yaml
- base/user-svc.yaml