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

docs: Added Advanced installation with Argo CD doc #3335

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

christianh814
Copy link
Member

Added different ways to deploy Kargo using Argo CD. I stuck with the 3 main ways folks would do this using Argo CD. I stayed away from Umbrella Charts as I feel folks would manage cert-manager and argo-rollouts with their own Argo CD Application. (also I think having a "Kargo + Cert Manager + Argo Rollouts" Umbrella chart would be bad practice)

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit aeb049d
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/6792f5976f3d1b0009e48847
😎 Deploy Preview https://deploy-preview-3335.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.47%. Comparing base (717a547) to head (aeb049d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3335   +/-   ##
=======================================
  Coverage   52.47%   52.47%           
=======================================
  Files         291      291           
  Lines       26617    26617           
=======================================
  Hits        13968    13968           
  Misses      11886    11886           
  Partials      763      763           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fykaa fykaa changed the title Added Advanced installation with Argo CD doc docs: Added Advanced installation with Argo CD doc Jan 22, 2025
@krancour
Copy link
Member

I stayed away from Umbrella Charts as I feel folks would manage cert-manager and argo-rollouts with their own Argo CD Application. (also I think having a "Kargo + Cert Manager + Argo Rollouts" Umbrella chart would be bad practice)

💯

I am supportive of this decision to make the prereqs their own responsibility. The reasons you cite are the same reasons that the Kargo chart doesn't use cert-manager or argo-cd charts as subcharts. Those two dependencies are extremely likely to already exist in a (non-local) cluster and even if they don't, I don't think anyone would want to couple their installation and configuration to their Kargo install instead of just managing them separately.

christianh814 and others added 10 commits January 23, 2025 19:45
Signed-off-by: Christian Hernandez <christian@chernand.io>
…on/20-advanced-with-argocd.md

Co-authored-by: Faeka Ansari <faeka6@gmail.com>
Signed-off-by: Christian Hernandez <christian@chernand.io>
…on/20-advanced-with-argocd.md


Taking out "Advanced"

Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
…on/20-advanced-with-argocd.md

Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
…on/20-advanced-with-argocd.md

Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
…on/20-advanced-with-argocd.md

Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Christian Hernandez <christian@chernand.io>
Signed-off-by: Christian Hernandez <christian@chernand.io>
Signed-off-by: Christian Hernandez <christian@chernand.io>
@krancour krancour force-pushed the advanced-installation-with-argo-cd branch from 04f60b7 to e333a9b Compare January 24, 2025 00:50
@krancour krancour changed the base branch from newdocs to main January 24, 2025 00:50
@krancour
Copy link
Member

@christianh814 fyi, I had to rebase this to make it mergeable to main. So if you do anything more to it, delete your local branch first and re-pull it from here.

Signed-off-by: Christian Hernandez <christian@chernand.io>
@christianh814
Copy link
Member Author

@krancour Ready for re-review

:::note
This section assumes that you have already installed any dependencies or prerequisites required for running Kargo on a Kubernetes cluster. Please refer to [Basic Installation](../../operator-guide/basic-installation#prerequisites) for more details.
:::

Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All methods described here will involve deploying Kargo using an Argo CD
`Application` resource that is configured to obtain Kargo's Helm chart directly
from its official repo. We will demonstrate a variety of ways to specify
your own configuration values using `api.adminAccount.passwordHash` and `api.adminAccount.tokenSigningKey` as examples since you are _required_ to
provide values for these anyway (unless
[the admin account is disabled instead](../40-security/10-secure-configuration.md#disabling-the-admin-account)).
Recommended commands for generating a complex password and signing key, and for hashing the password as required are:
```console
pass=$(openssl rand -base64 48 | tr -d "=+/" | head -c 32)
echo "Password: $pass"
echo "Password Hash: $(htpasswd -bnBC 10 "" $pass | tr -d ':\n')"
echo "Signing Key: $(openssl rand -base64 48 | tr -d "=+/" | head -c 32)"
```
:::note
Methods of securing the admin account are explored in greater detail [here](../40-security/10-secure-configuration.md#securing-the-admin-account).
:::


## Direct Argo CD Application

The most common way to deploy Kargo using Argo CD is to create an `Application` and use the Helm chart directly. Using this method, you can use the `.spec.source.helm.parameters` section to specify any parameters you may need. This is the most straightforward way to deploy Kargo using Argo CD.
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The most common way to deploy Kargo using Argo CD is to create an `Application` and use the Helm chart directly. Using this method, you can use the `.spec.source.helm.parameters` section to specify any parameters you may need. This is the most straightforward way to deploy Kargo using Argo CD.
The most straightforward way to specify chart configuration options is by using the
`Application`'s `spec.source.helm.parameters` field:

helm:
parameters:
- name: api.adminAccount.passwordHash
value: "$$2a$$10$$Zrhhie4vLz5ygtVSaif6o.qN36jgs6vjtMBdM6yrU1FOeiAAMMxOm"
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's too much danger of someone blindly using the example password -- it's only admin. I'll make another suggestion up above with instructions for generating a password.

Suggested change
value: "$$2a$$10$$Zrhhie4vLz5ygtVSaif6o.qN36jgs6vjtMBdM6yrU1FOeiAAMMxOm"
# Note: A bcrypt-hashed password will contain `$` characters that
# MUST each be escaped as `$$`
value: <bcrypt-hashed password>

- name: api.adminAccount.tokenTTL
value: "24h"
- name: api.adminAccount.tokenSigningKey
value: "iwishtowashmyirishwristwatch"
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment to this one

Suggested change
value: "iwishtowashmyirishwristwatch"
value: <token signing key>

Comment on lines +41 to +44
- name: controller.logLevel
value: "DEBUG"
- name: api.adminAccount.tokenTTL
value: "24h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: controller.logLevel
value: "DEBUG"
- name: api.adminAccount.tokenTTL
value: "24h"

Comment on lines +55 to +57
:::info
If using the `api.adminAccount.passwordHash` parameter in this method, you must escape the `$` character with `$$` to prevent Helm from interpreting it as a variable. Please see [this discussion](https://discord.com/channels/1138942074998235187/1138946346217394407/1267966083168469102) for more information.
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A previous suggestion puts this in a comment directly above where it's relevant so it
can't be missed.

Suggested change
:::info
If using the `api.adminAccount.passwordHash` parameter in this method, you must escape the `$` character with `$$` to prevent Helm from interpreting it as a variable. Please see [this discussion](https://discord.com/channels/1138942074998235187/1138946346217394407/1267966083168469102) for more information.
:::

If using the `api.adminAccount.passwordHash` parameter in this method, you must escape the `$` character with `$$` to prevent Helm from interpreting it as a variable. Please see [this discussion](https://discord.com/channels/1138942074998235187/1138946346217394407/1267966083168469102) for more information.
:::

Conversely, insetad of using the `parameters` field under the `.spec.source.helm` section; you can use the `values` block or `valuesObject` object to specify the values for the Kargo Helm chart. Below is an example of how to use `valuesObject` to specify the values.
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conversely == opposite, which is probably not the right idea here.

Suggested change
Conversely, insetad of using the `parameters` field under the `.spec.source.helm` section; you can use the `values` block or `valuesObject` object to specify the values for the Kargo Helm chart. Below is an example of how to use `valuesObject` to specify the values.
## `spec.source.helm.values`
Alternatively, instead of using `spec.source.helm`'s `parameters` field, you can use the either of the `values` or `valuesObject` fields to specify configuration options for the chart:

Conversely, insetad of using the `parameters` field under the `.spec.source.helm` section; you can use the `values` block or `valuesObject` object to specify the values for the Kargo Helm chart. Below is an example of how to use `valuesObject` to specify the values.

```yaml
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---

Comment on lines +131 to +136

The `parametes` section isn't used in this method, instead the `values.yaml` file is hosted in a separate repository and is referenced using the `ref` field.

## What's Next?

Now that you have deployed Kargo using Argo CD, you can explore the various features and capabilities of Kargo. Please see the [Operator Guide](../../operator-guide/) or the [User Guide](../../user-guide/) for futher information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `parametes` section isn't used in this method, instead the `values.yaml` file is hosted in a separate repository and is referenced using the `ref` field.
## What's Next?
Now that you have deployed Kargo using Argo CD, you can explore the various features and capabilities of Kargo. Please see the [Operator Guide](../../operator-guide/) or the [User Guide](../../user-guide/) for futher information.

Comment on lines +81 to +82
passwordHash: $2a$10$Zrhhie4vLz5ygtVSaif6o.qN36jgs6vjtMBdM6yrU1FOeiAAMMxOm
tokenSigningKey: iwishtowashmyirishwristwatch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
passwordHash: $2a$10$Zrhhie4vLz5ygtVSaif6o.qN36jgs6vjtMBdM6yrU1FOeiAAMMxOm
tokenSigningKey: iwishtowashmyirishwristwatch
passwordHash: <bcrypt-hashed password>
tokenSigningKey: <token signing key>


## Multi-Source Argo CD Application

Another method is to use a Multi-Source Argo CD Application. Here, you'd use the `.spec.sources` field and store your values files in a separate repository. This is useful if you are using GitOps to track your values configuration changes, but will still use the public Helm chart repository.
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Another method is to use a Multi-Source Argo CD Application. Here, you'd use the `.spec.sources` field and store your values files in a separate repository. This is useful if you are using GitOps to track your values configuration changes, but will still use the public Helm chart repository.
__Our recommended method__ is to use an `Application` with
[multiple sources](https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/) to reference _both_ the Kargo Helm chart repository a `values.yaml`
of your own from your own Git repository.
__This is our recommendation because it aligns best with with GitOps principles.__

Comment on lines +98 to +100
:::info
We recommend using this method as it more closely aligns with GitOps principles and best practices.
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Factored into text higher up.

Suggested change
:::info
We recommend using this method as it more closely aligns with GitOps principles and best practices.
:::

:::

```yaml
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---

:::info
We recommend using this method as it more closely aligns with GitOps principles and best practices.
:::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the configuration below, the second source (the one with `repoURL` pointed at your own Git repository) is assigned a `ref` of `values`. This permits content from that
repository (in particular, a `values.yaml` file) to be referenced by the _other_ source:

This section assumes that you have already installed any dependencies or prerequisites required for running Kargo on a Kubernetes cluster. Please refer to [Basic Installation](../../operator-guide/basic-installation#prerequisites) for more details.
:::

## Direct Argo CD Application
Copy link
Member

@krancour krancour Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Direct Argo CD Application
## `spec.source.helm.parameters`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants