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

Merge dev to main #332

Merged
merged 9 commits into from
Jul 11, 2024
Merged

Merge dev to main #332

merged 9 commits into from
Jul 11, 2024

Conversation

gianlucam76
Copy link
Member

Post release v0.34.0

gianlucam76 and others added 9 commits July 6, 2024 13:35
Besides resource referenced by ClusterProfile/Profile, also:

- EventTrigger references EventSource
- ClusterHealthCheck references LivenessSourceRef

and those need to be expressed as template as well for consistency
Classifier will also need those method to customize
sveltos-agent before deploying to managed cluster.

This PR is simply moving what was in addon-controller to libsveltos
(no other changes)
Move patcher from addon-controller to libsveltos
When multiple resources had to be patched there was an issue.
This PR fixes it.

```bash
wget https://github.com/fluxcd/flux2/releases/download/v2.3.0/install.yaml
kubectl create configmap install-flux --from-file=install.yaml
```

Then create a ClusterProfile referencing above ConfigMap with patches

```yaml
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: fluxcd
spec:
  clusterSelector:
    matchLabels:
      env: fv
  syncMode: ContinuousWithDriftDetection
  policyRefs:
  - name: install-flux
    namespace: default
    kind: ConfigMap
  patches:
  - target:
      kind: Namespace
      name: ".*"
    patch: |
      - op: add
        path: /metadata/labels/type
        value: operator
```

all resources are deployed. Snipped from ClusterSummary:

```yaml
  status:
    dependencies: no dependencies
    deployedGVKs:
    - deployedGroupVersionKind:
      - Namespace.v1.
      - ResourceQuota.v1.
      - CustomResourceDefinition.v1.apiextensions.k8s.io
      - ServiceAccount.v1.
      - ClusterRole.v1.rbac.authorization.k8s.io
      - ClusterRoleBinding.v1.rbac.authorization.k8s.io
      - Service.v1.
      - Deployment.v1.apps
      - NetworkPolicy.v1.networking.k8s.io
      featureID: Resources
    featureSummaries:
    - featureID: Resources
      hash: fbu02/VIWPD2uWEi/0reXeS/SAv740mmTTTYz0A66Q8=
      lastAppliedTime: "2024-07-10T12:07:31Z"
      status: Provisioned
```

and the namespace has the `type: operator` label

```yaml
apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: "2024-07-10T12:07:23Z"
  labels:
    ...
    type: operator
  name: flux-system
```
@gianlucam76 gianlucam76 merged commit 75fbc59 into projectsveltos:main Jul 11, 2024
4 checks passed
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.

1 participant