Skip to content

Commit

Permalink
Small corrections to the air-gapped installation and update of the dr…
Browse files Browse the repository at this point in the history
…ift detection section (#452)
  • Loading branch information
egrosdou01 authored Jan 27, 2025
1 parent c91aa10 commit 15f8ac5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 93 deletions.
107 changes: 17 additions & 90 deletions docs/features/configuration_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,107 +114,52 @@ spec:

## Customize drift-detection-manager configuration

In some cases, you might want to tailor the deployment of the drift-detection-manager[^1]. To achieve this, the `addon-controller` pod now accepts a new argument named `drift-detection-config`.
In some cases, we might want to tailor the deployment of the `drift-detection-manager`. To achieve this, the `addon-controller` pod accepts a new argument named `drift-detection-config`.

This argument points to a ConfigMap within the projectsveltos namespace. The ConfigMap holds patches that will be applied to the drift-detection-manager before its deployment in the managed cluster.
The `drift-detection-config` argument points to a `ConfigMap` within the **projectsveltos** namespace. The `ConfigMap` holds patches that will be applied to the `drift-detection-manager` before its deployment in the managed cluster.

Here's an example:
#### ConfigMap Example

```yaml
apiVersion: v1
data:
patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: drift-detection-manager
spec:
template:
spec:
containers:
- name: manager
image: docker.io/projectsveltos/drift-detection-manager:dev
resources:
requests:
memory: 256Mi
kind: ConfigMap
metadata:
name: drift-detection
namespace: projectsveltos
```

Along with creating the ConfigMap, you'll also need to configure the addon-controller deployment to use it. To do this, add the following argument to the deployment:

```yaml
- args:
...
- --drift-detection-config=drift-detection
```

With this configuration, the drift-detection-manager will be deployed in each managed cluster with the following settings:

- Request memory: 256Mi
- Image: projectsveltos/drift-detection-manager:dev

## Pulling Sveltos Agent Images from a Private Registry

Same is valid for `sveltos-agent`. classifier pod now accepts an argument named `sveltos-agent-config`. It points to a ConfigMap in the projectsveltos namespace.
The ConfigMap holds patches that will be applied to the sveltos-agent before its deployment in the managed cluster.

This is particularly useful for scenarios like:

- **Using private image registries**: Override the default image repository and tag.
- **Adding proxy settings**: Include `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables.
- **Any other deployment-level customizations**.

Here is an example ConfigMap for customizing the `sveltos-agent`:

```yaml
apiVersion: v1
data:
patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: sveltos-agent-manager
name: drift-detection-manager
spec:
template:
spec:
imagePullSecrets:
- name: my-registry-secret
containers:
- name: manager
image: registry.company.io/projectsveltos/sveltos-agent:dev
kind: ConfigMap
metadata:
name: sveltos-agent-config
namespace: projectsveltos
- name: manager
image: registry.company.io/projectsveltos/drift-detection-manager:dev
resources:
requests:
memory: 256Mi
```

Along with creating the ConfigMap, you'll also need to configure the `classifer-manager` deployment to use it. To do this, add the following argument to the deployment:
Along with creating the `ConfigMap`, we also need to configure the **addon-controller** deployment to use it. To do this, add the below argument to the deployment.

```yaml
- args:
...
- - --sveltos-agent-config=sveltos-agent-config
- --drift-detection-config=drift-detection
```

With this setup, the sveltos-agent will be deployed in the management cluster with the following settings:
With the defined configuration, the `drift-detection-manager` will get deployed in each **managed cluster** with the below settings.

- Custom image from private registry: registry.company.io/projectsveltos/sveltos-agent:dev
- Private registry credentials: my-registry-secret (the secret must be present in the projectsveltos namespace)
- Proxy settings: HTTP_PROXY, HTTPS_PROXY, and NO_PROXY defined.
- **Request memory**: 256Mi
- **Image**: projectsveltos/drift-detection-manager:dev

!!! tip ""
To create a Secret, provide your credentials directly on the command line using the following command:
```
kubectl create secret docker-registry my-registry-secret -n projectsveltos --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>
```
!!! tip
If you are deploying Sveltos using the official Helm chart and need to patch the `drift-detection-manager` before deployment, include the necessary values in your `values.yaml` file.

!!! tip ""
If you are deploying Sveltos using the Helm chart and need to patch sveltos-agent and drift-detection before deployment, include the necessary values in your values.yaml file and use the following command

helm install projectsveltos projectsveltos/projectsveltos -n projectsveltos -f values.yaml
$ helm install projectsveltos projectsveltos/projectsveltos -n projectsveltos -f values.yaml

```yaml
addonController:
Expand All @@ -233,24 +178,6 @@ With this setup, the sveltos-agent will be deployed in the management cluster wi
- --v=5
- --version=v0.44.0
- --drift-detection-config=drift-detection-config
classifierManager:
manager:
args:
- --diagnostics-address=:8443
- --report-mode=0
- --shard-key=
- --v=5
- --version=v0.44.0
argsAgentMgmtCluster:
- --diagnostics-address=:8443
- --report-mode=0
- --agent-in-mgmt-cluster
- --shard-key=
- --v=5
- --version=v0.44.0
- --sveltos-agent-config=sveltos-agent-config
agent:
managementCluster: true
```
14 changes: 11 additions & 3 deletions docs/getting_started/install/air_gapped_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The *drift-detection-manager* image is located [here](https://hubgw.docker.com/l

Apart from deploying the `ConfigMap` resource in the **management** cluster, the argument `--drift-detection-config=drift-detection` needs to be included in the `addon-controller` of the ProjectSveltos `Helm chart`. The official `Helm chart` values are located [here](https://github.com/projectsveltos/helm-charts/blob/main/charts/projectsveltos/values.yaml).

```yaml
```yaml hl_lines="17"
...
addonController:
controller:
Expand Down Expand Up @@ -104,14 +104,22 @@ data:
image: registry.company.io/projectsveltos/sveltos-agent:dev
```

The *sveltos-agent* image is located [here](https://hubgw.docker.com/layers/projectsveltos/sveltos-agent/dev/images/sha256-d2c23f55e4585e9cfd103547bd238aef42f8cedb1d8ca23600bd393710669b37).
The *sveltos-agent* **image** is located [here](https://hubgw.docker.com/layers/projectsveltos/sveltos-agent/dev/images/sha256-d2c23f55e4585e9cfd103547bd238aef42f8cedb1d8ca23600bd393710669b37).

The *sveltos-agent* will be deployed in the **management** cluster with the bellow settings.

- **Custom image from private registry**: registry.company.io/projectsveltos/sveltos-agent:dev
- **Private registry credentials**: my-registry-secret (the secret must be present in the **projectsveltos** namespace)
- **Proxy settings**: HTTP_PROXY, HTTPS_PROXY, and NO_PROXY defined.

!!! tip
Replace the `image: registry.company.io/projectsveltos/sveltos-agent:dev` argument with your private registry details.

To create the `my-registry-secret` Secret, provide your credentials directly using the command: ```kubectl create secret docker-registry my-registry-secret -n projectsveltos --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>```

Include the argument `--sveltos-agent-config=sveltos-agent-config` to the `classifer-manager` deployment within the Helm chart values.

```yaml
```yaml hl_lines="16"
classifierManager:
manager:
args:
Expand Down

0 comments on commit 15f8ac5

Please sign in to comment.