forked from argoproj/argocd-example-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config template plugin examples (argoproj#7)
- Loading branch information
Showing
13 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: guestbook-ui | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
selector: | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: guestbook-ui | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: guestbook-ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Config Management Plugins Examples | ||
|
||
| Application | Description | | ||
|-------------|-------------| | ||
| [kasane](kasane/) | The guestbook application as a `kasane` package. | | ||
| [kustomized-helm](kustomized-helm/) | Application comprised of a `helm` chart and customized using `kustomize` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
vendor | ||
Kasanefile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layers: | ||
- ../../guestbook/guestbook-ui-deployment.yaml | ||
- patch.jsonnet | ||
- ../../guestbook/guestbook-ui-svc.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Kasane | ||
|
||
[Kasane](https://github.com/google/kasane) is a layering tool for Kubernetes which utilises Jsonnet for deep object modification and patching. | ||
|
||
Use following steps to try the application: | ||
|
||
* Follow instructions from [custom_tools.md](https://github.com/argoproj/argo-cd/blob/master/docs/custom_tools.md) to make sure `kasane` binary is available in `argocd-repo-server` pod. | ||
* Register `kasane` plugin `argocd-cm` ConfigMap: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
data: | ||
configManagementPlugins: | | ||
- name: kasane | ||
init: | ||
command: [kasane, update] | ||
generate: | ||
command: [kasane, show] | ||
``` | ||
* Create application using `kasane` as a config management plugin name. | ||
|
||
``` | ||
argocd app create kasane \ | ||
--config-management-plugin kasane \ | ||
--repo https://github.com/argoproj/argocd-example-apps \ | ||
--path plugins/kasane \ | ||
--dest-server https://kubernetes.default.svc \ | ||
--dest-namespace default | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function (layers) | ||
|
||
[ | ||
layers[0] { | ||
spec+: { | ||
replicas: 2, | ||
}, | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
all.yaml | ||
charts | ||
requirements.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: guestbook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Helm + Kustomize | ||
|
||
Sometimes Helm chart don't have all required parameters and additional customization is required. This example application demonstrates how to combine Helm and Kustomize and use it | ||
as a config management plugin in Argo CD. | ||
|
||
Use following steps to try the application: | ||
|
||
* configure `kustomized-helm` tool in `argocd-cm` ConfigMap: | ||
|
||
```yaml | ||
configManagementPlugins: | | ||
- name: kustomized-helm | ||
init: | ||
command: [helm, dependency, build] | ||
generate: | ||
command: [sh, -c] | ||
args: ["helm template . > all.yaml && kustomize build"] | ||
``` | ||
* create application using `kustomized-helm` as a config management plugin name: | ||
|
||
|
||
``` | ||
argocd app create kustomized-helm \ | ||
--config-management-plugin kustomized-helm \ | ||
--repo https://github.com/argoproj/argocd-example-apps \ | ||
--path plugins/kustomized-helm \ | ||
--dest-server https://kubernetes.default.svc \ | ||
--dest-namespace default | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namePrefix: kustomize- | ||
|
||
resources: | ||
- ./all.yaml | ||
|
||
patches: | ||
- overlays/guestbook-deployment.yaml |
10 changes: 10 additions & 0 deletions
10
plugins/kustomized-helm/overlays/guestbook-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: release-name-helm-guestbook | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: helm-guestbook | ||
image: "gcr.io/heptio-images/ks-guestbook-demo:0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies: | ||
- name: helm-guestbook | ||
version: 0.1.0 | ||
repository: file://../../helm-guestbook |