diff --git a/README.md b/README.md index 9b0ec34..b0370ac 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ to explore ArgoCD and GitOps! | [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 | +| [helm-dependency](helm2-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) diff --git a/helm-dependency/Chart.yaml b/helm-dependency/Chart.yaml index 59ca9a9..265c983 100644 --- a/helm-dependency/Chart.yaml +++ b/helm-dependency/Chart.yaml @@ -1 +1,28 @@ -name: wordpress \ No newline at end of file +apiVersion: v2 +name: wordpress +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: "1.0" + +dependencies: +- name: wordpress + version: 5.0.2 + repository: https://charts.helm.sh/stable \ No newline at end of file diff --git a/helm2-dependency/Chart.yaml b/helm2-dependency/Chart.yaml new file mode 100644 index 0000000..59ca9a9 --- /dev/null +++ b/helm2-dependency/Chart.yaml @@ -0,0 +1 @@ +name: wordpress \ No newline at end of file diff --git a/helm2-dependency/README.md b/helm2-dependency/README.md new file mode 100644 index 0000000..7353e26 --- /dev/null +++ b/helm2-dependency/README.md @@ -0,0 +1,55 @@ +# Helm Dependencies + +This example application demonstrates how an OTS (off-the-shelf) helm chart can be retrieved and +pinned to a specific helm sem version from an upstream helm repository, and customized using a custom +values.yaml in the private git repository. + +In this example, the wordpress application is pulled from the stable helm repo, and pinned to v5.0.2: + +```yaml +dependencies: +- name: wordpress + version: 5.0.2 + repository: https://charts.helm.sh/stable +``` + +A custom values.yaml is used to customize the parameters of the wordpress helm chart: + +```yaml +wordpress: + wordpressPassword: foo + mariadb: + db: + password: bar + rootUser: + password: baz +``` + +### Subchart Note + +The wordpress chart referenced in this example contains a subchart for mariadb as specified in the requirements.yaml file of the wordpress chart: +```yaml +- name: mariadb + version: 5.x.x + repository: https://charts.helm.sh/stable + condition: mariadb.enabled + tags: + - wordpress-database +``` + +In order to disable this chart, you must set the value to false for both `mariadb.enabled` and `wordpress.mariadb.enabled`. The first is used by the mariadb subchart condition field, the second is used by the wordpress chart deployment template. An example demonstration is available in the values-nomaria.yaml file: +```yaml +mariadb: + enabled: false + +wordpress: + wordpressPassword: foo + mariadb: + enabled: false + externalDatabase: + host: localhost + user: bn_wordpress + password: "" + database: bitnami_wordpress + port: 3306 +``` \ No newline at end of file diff --git a/helm-dependency/requirements.yaml b/helm2-dependency/requirements.yaml similarity index 100% rename from helm-dependency/requirements.yaml rename to helm2-dependency/requirements.yaml diff --git a/helm2-dependency/values-nomaria.yaml b/helm2-dependency/values-nomaria.yaml new file mode 100644 index 0000000..98f17bc --- /dev/null +++ b/helm2-dependency/values-nomaria.yaml @@ -0,0 +1,13 @@ +mariadb: + enabled: false + +wordpress: + wordpressPassword: foo + mariadb: + enabled: false + externalDatabase: + host: localhost + user: bn_wordpress + password: "" + database: bitnami_wordpress + port: 3306 \ No newline at end of file diff --git a/helm2-dependency/values.yaml b/helm2-dependency/values.yaml new file mode 100644 index 0000000..a954a18 --- /dev/null +++ b/helm2-dependency/values.yaml @@ -0,0 +1,7 @@ +wordpress: + wordpressPassword: foo + mariadb: + db: + password: bar + rootUser: + password: baz