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: deploy Keptn via ArgoCD #3256

Merged
merged 10 commits into from
Mar 14, 2024
Merged
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 .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -689,3 +689,4 @@ yourregistry
GOGC
otelcol
serviceapp
finalizer
50 changes: 50 additions & 0 deletions docs/docs/installation/configuration/argocd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
comments: true
---

# Deploy Keptn via ArgoCD

Keptn can be deployed on your Kubernetes cluster
via [ArgoCD](https://argoproj.github.io/cd/).

## Before you begin

To successfully deploy Keptn via ArgoCD, you need to
have ArgoCD installed on your cluster.
You can find the
[installation instructions](https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/)
in the ArgoCD documentation.

## Creating Argo Application

After successfully installing ArgoCD, you need to create
an Argo Application and define the
repository containing Keptn helm charts:

```yaml
{% include "./assets/argo-app.yaml" %}
```

After applying the Application to your cluster,
Argo will fetch the state of the linked repository
and deploy the content via helm.

You can access the ArgoCD UI to see that
Keptn is up and running.

![keptn argo](./assets/argo-keptn.png)

> **Note**
Please be aware, that you need to enable
[cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#cascading-deletion)
of the application, which is disabled by default in ArgoCD.
You can enable it by adding the deletion finalizers into your
Argo Application, like it's done in the example above.
More information about the deletion finalizers can be found
[here](https://argo-cd.readthedocs.io/en/stable/user-guide/app_deletion/#about-the-deletion-finalizer).

```yaml
metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io # enabling cascading deletion
```
26 changes: 26 additions & 0 deletions docs/docs/installation/configuration/assets/argo-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: keptn
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io # enabling cascading deletion
spec:
project: default
source:
repoURL: 'https://charts.lifecycle.keptn.sh' # helm chart repository
chart: keptn # helm chart name
targetRevision: 0.5.1 # helm chart version - use latest available here
helm:
parameters:
- name: "commitID"
value: "$ARGOCD_APP_REVISION"
destination:
server: 'https://kubernetes.default.svc' # server where Keptn will be deployed
namespace: keptn-system # namespace where Keptn will be deployed
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/docs/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ See
[Running Keptn with vCluster](./configuration/vcluster.md)
for more information.

If you want to deploy Keptn via [ArgoCD](https://argoproj.github.io/cd/),
refer to the [Deploying Keptn via ArgoCD](./configuration/argocd.md) section
for more information.

## Basic installation

Keptn is installed onto an existing Kubernetes cluster
Expand Down
31 changes: 13 additions & 18 deletions docs/docs/installation/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,19 @@ More information can be found in the

## I have pending Pods after Keptn is uninstalled

> **Note** This section particularly affects clusters managed by ArgoCD.

If you have uninstalled Keptn and are now facing issues scheduling or deleting pods, follow these steps:

ArgoCD does not delete various CRDs and webhooks, when uninstalling applications, causing lingering resources.

### For cleanup instructions

1. Install Keptn & CRDs w/ Argo
2. Uninstall Keptn via Argo
3. Cluster is frozen, Pods cannot be deleted or scheduled

Trying to schedule a new pod results an `mpod.keptn.sh` error.

Reason: Argo doesn't remove the CRDs and global objects (mutating webhooks) and the
[default failurePolicy is to fail](https://github.com/keptn/lifecycle-toolkit/blob/650ecba95624ed3dc2bd61bf1f86578f450223a5/operator/config/webhook/manifests.yaml#L17).

to get further information refer to this [issue](https://github.com/keptn/lifecycle-toolkit/issues/1828).
> **Note** This section particularly affects clusters where
Keptn was installed via ArgoCD.

If you have uninstalled Keptn, originally installed via ArgoCD
and are now facing issues scheduling or deleting pods for other applications,
you probably didn't enable
[cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#cascading-deletion)
of the application during installation, which is disabled by default in ArgoCD.

To fix this problem, you need to install Keptn via ArgoCD again, with the use
RealAnna marked this conversation as resolved.
Show resolved Hide resolved
of `finalizers` in your Argo Application.
For more information see the
[Deploy Keptn via ArgoCD](./configuration/argocd.md) section for more information.

## I cannot see DORA metrics or OpenTelemetry traces

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ nav:
- How to structure your namespaces: docs/installation/configuration/namespace.md
- vCluster installation: docs/installation/configuration/vcluster.md
- Keptn + cert-manager.io: docs/installation/configuration/cert-manager.md
- Deploy Keptn via ArgoCD: docs/installation/configuration/argocd.md
- Installation Tips and Tricks: docs/installation/tips-tricks.md
- Troubleshooting Guide: docs/installation/troubleshooting.md
- Kubernetes cluster: docs/installation/k8s.md
Expand Down
Loading