diff --git a/README.md b/README.md index 333ac4a..7b5ba30 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,11 @@ to explore ArgoCD and GitOps! | Application | Description | |-------------|-------------| -| [guestbook](guestbook/) | The ksonnet hello word application | +| [guestbook](guestbook/) | A hello word application | +| [ksonnet-guestbook](ksonnet-guestbook/) | The guestbook application as a ksonnet app | | [helm-guestbook](helm-guestbook/) | The guestbook application as a Helm chart | | [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook application as a raw jsonnet | +| [kustomize-guestbook](kustomize-guestbook/) | The guestbook application as a kustomize app | | [pre-post-sync](pre-post-sync/) | Demonstrates ArgoCD PreSync and PostSync hooks | | [blue-green-deploy](blue-green-deploy/) | Demonstrates an ArgoCD Sync hook which performs a blue/green deployment | | [sock-shop](sock-shop/) | A microservices demo application (https://microservices-demo.github.io) | diff --git a/guestbook/guestbook-ui-deployment.yaml b/guestbook/guestbook-ui-deployment.yaml new file mode 100644 index 0000000..92fd91b --- /dev/null +++ b/guestbook/guestbook-ui-deployment.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: guestbook-ui +spec: + replicas: 1 + selector: + matchLabels: + app: guestbook-ui + template: + metadata: + labels: + app: guestbook-ui + spec: + containers: + - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 + name: guestbook-ui + ports: + - containerPort: 80 diff --git a/guestbook/guestbook-ui-svc.yaml b/guestbook/guestbook-ui-svc.yaml new file mode 100644 index 0000000..d96a325 --- /dev/null +++ b/guestbook/guestbook-ui-svc.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: guestbook-ui +spec: + ports: + - port: 80 + targetPort: 80 + selector: + app: guestbook-ui + type: LoadBalancer diff --git a/guestbook/.gitignore b/ksonnet-guestbook/.gitignore similarity index 100% rename from guestbook/.gitignore rename to ksonnet-guestbook/.gitignore diff --git a/guestbook/app.yaml b/ksonnet-guestbook/app.yaml similarity index 100% rename from guestbook/app.yaml rename to ksonnet-guestbook/app.yaml diff --git a/guestbook/components/guestbook-ui.jsonnet b/ksonnet-guestbook/components/guestbook-ui.jsonnet similarity index 100% rename from guestbook/components/guestbook-ui.jsonnet rename to ksonnet-guestbook/components/guestbook-ui.jsonnet diff --git a/guestbook/components/params.libsonnet b/ksonnet-guestbook/components/params.libsonnet similarity index 94% rename from guestbook/components/params.libsonnet rename to ksonnet-guestbook/components/params.libsonnet index e571709..162ad1f 100644 --- a/guestbook/components/params.libsonnet +++ b/ksonnet-guestbook/components/params.libsonnet @@ -9,7 +9,7 @@ "guestbook-ui": { containerPort: 80, image: "gcr.io/heptio-images/ks-guestbook-demo:0.2", - name: "guestbook-ui", + name: "ks-guestbook-ui", replicas: 1, servicePort: 80, type: "LoadBalancer", diff --git a/guestbook/environments/base.libsonnet b/ksonnet-guestbook/environments/base.libsonnet similarity index 100% rename from guestbook/environments/base.libsonnet rename to ksonnet-guestbook/environments/base.libsonnet diff --git a/guestbook/environments/default/globals.libsonnet b/ksonnet-guestbook/environments/default/globals.libsonnet similarity index 100% rename from guestbook/environments/default/globals.libsonnet rename to ksonnet-guestbook/environments/default/globals.libsonnet diff --git a/guestbook/environments/default/main.jsonnet b/ksonnet-guestbook/environments/default/main.jsonnet similarity index 100% rename from guestbook/environments/default/main.jsonnet rename to ksonnet-guestbook/environments/default/main.jsonnet diff --git a/guestbook/environments/default/params.libsonnet b/ksonnet-guestbook/environments/default/params.libsonnet similarity index 100% rename from guestbook/environments/default/params.libsonnet rename to ksonnet-guestbook/environments/default/params.libsonnet diff --git a/guestbook/environments/dev/globals.libsonnet b/ksonnet-guestbook/environments/dev/globals.libsonnet similarity index 100% rename from guestbook/environments/dev/globals.libsonnet rename to ksonnet-guestbook/environments/dev/globals.libsonnet diff --git a/guestbook/environments/dev/main.jsonnet b/ksonnet-guestbook/environments/dev/main.jsonnet similarity index 100% rename from guestbook/environments/dev/main.jsonnet rename to ksonnet-guestbook/environments/dev/main.jsonnet diff --git a/guestbook/environments/dev/params.libsonnet b/ksonnet-guestbook/environments/dev/params.libsonnet similarity index 100% rename from guestbook/environments/dev/params.libsonnet rename to ksonnet-guestbook/environments/dev/params.libsonnet diff --git a/guestbook/environments/prod/globals.libsonnet b/ksonnet-guestbook/environments/prod/globals.libsonnet similarity index 100% rename from guestbook/environments/prod/globals.libsonnet rename to ksonnet-guestbook/environments/prod/globals.libsonnet diff --git a/guestbook/environments/prod/main.jsonnet b/ksonnet-guestbook/environments/prod/main.jsonnet similarity index 100% rename from guestbook/environments/prod/main.jsonnet rename to ksonnet-guestbook/environments/prod/main.jsonnet diff --git a/guestbook/environments/prod/params.libsonnet b/ksonnet-guestbook/environments/prod/params.libsonnet similarity index 100% rename from guestbook/environments/prod/params.libsonnet rename to ksonnet-guestbook/environments/prod/params.libsonnet diff --git a/kustomize-guestbook/base/kustomization.yaml b/kustomize-guestbook/base/kustomization.yaml new file mode 100644 index 0000000..9f633bd --- /dev/null +++ b/kustomize-guestbook/base/kustomization.yaml @@ -0,0 +1,5 @@ +namePrefix: kustomize- + +resources: +- ../../guestbook/guestbook-ui-deployment.yaml +- ../../guestbook/guestbook-ui-svc.yaml diff --git a/kustomize-guestbook/dev/kustomization.yaml b/kustomize-guestbook/dev/kustomization.yaml new file mode 100644 index 0000000..c08e342 --- /dev/null +++ b/kustomize-guestbook/dev/kustomization.yaml @@ -0,0 +1,7 @@ +namePrefix: dev- + +bases: +- ../base + +commonLabels: + environment: dev diff --git a/kustomize-guestbook/prod/kustomization.yaml b/kustomize-guestbook/prod/kustomization.yaml new file mode 100644 index 0000000..ddde8be --- /dev/null +++ b/kustomize-guestbook/prod/kustomization.yaml @@ -0,0 +1,11 @@ +namePrefix: prod- + +bases: +- ../base + +commonLabels: + environment: prod + +imageTags: + - name: gcr.io/heptio-images/ks-guestbook-demo + newTag: "0.1"