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

Drift detection manager #622

Merged

Conversation

gianlucam76
Copy link
Member

Sometimes it is useful to customize drift-detection-manager deployment. Addon-controller accepts a new arg: drift-detection-config

That is the name of the ConfigMap in the projectsveltos namespace that contains patches that will be applied to drift-detection-manager before it gets deployed in the managed cluster.

For instance, creating this ConfigMap

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

and setting the following extra argurment to addon-controller deployment

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

the drift-detection-manager will be deployed in each managed cluster with 256Mi for request memory and image projectsveltos/drift-detection-manager:dev

Fixes #594

gianlucam76 and others added 4 commits July 6, 2024 14:52
Those methods are moved to libsveltos since used by other repos.

This PR also rewrite hash functions by moving ClusterProfileSpec hash evaluation
in its own function instead of having it repeated in different places.
Template: GetReferenceResourceNamespace and GetReferenceResourceName
Sometimes it is useful to customize drift-detection-manager deployment.
Addon-controller accepts a new arg: `drift-detection-config`

That is the name of the ConfigMap in the `projectsveltos` namespace
that contains patches that will be applied to drift-detection-manager
before it gets deployed in the managed cluster.

For instance, creating this ConfigMap

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

and setting the following extra argurment to addon-controller deployment

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

the drift-detection-manager will be deployed in each managed cluster with
256Mi for request memory and image `projectsveltos/drift-detection-manager:dev`
@gianlucam76 gianlucam76 merged commit 0434559 into projectsveltos:main Jul 8, 2024
5 checks passed
@gianlucam76 gianlucam76 deleted the drift-detection-manager branch July 8, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: workload-config for drift-detection-manager
1 participant