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

BUG: Helm with yaml configmap templates incorrectly get parsed by sveltos #538

Closed
thecodeassassin opened this issue May 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@thecodeassassin
Copy link

Problem Description

This yaml in the linstor helm repo is treated as if it was a policyRef configmap.

It should not be parsed at all, otherwise all charts that have yaml files as configmaps will fail to deploy.

https://github.com/piraeusdatastore/piraeus-operator/blob/c27bf54a81fe6e6c0674c6492fdd9fbc9d4269a3/charts/piraeus/templates/config.yaml#L11

1 Failure Message: failed to decode k8s resource # This is the configuration for default images. Err: Object 'Kind' is missing in 1

System Information

CLUSTERAPI VERSION: latest
SVELTOS VERSION: 0.29
KUBERNETES VERSION: 1.29.1

Logs

INSTRUCTIONS: Provide any additional information you think would be helpful below. Large files, logs, etc. can be attached to this issue so long as they meet the GitHub attachment guidelines described here: https://help.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests

Name:         storage-capi-europe-north
Namespace:    default
Labels:       argocd.argoproj.io/instance=bootstrap
              projectsveltos.io/cluster-name=europe-north
              projectsveltos.io/cluster-profile-name=storage
              projectsveltos.io/cluster-type=Capi
Annotations:  <none>
API Version:  config.projectsveltos.io/v1alpha1
Kind:         ClusterSummary
Spec:
  Cluster Name:       europe-north
  Cluster Namespace:  default
  Cluster Profile Spec:
    Cluster Selector:  purpose=edge
    Depends On:
      cert-manager
      base-secrets
    Helm Charts:
      Chart Name:         dtrdnk-helm-charts/piraeus
      Chart Version:      2.2.0
      Helm Chart Action:  Install
      Release Name:       linstor
      Release Namespace:  piraeus-datastore
      Repository Name:    dtrdnk-helm-charts
      Repository URL:     https://dtrdnk.github.io/helm-charts
      Values:             installCRDs: true

    Reloader:                false
    Stop Matching Behavior:  WithdrawPolicies
    Sync Mode:               ContinuousWithDriftDetection
  Cluster Type:              Capi
Status:
  Dependencies:  All dependencies deployed
  Feature Summaries:
    Deployed Group Version Kind:
      Issuer.v1.cert-manager.io
      Certificate.v1.cert-manager.io
      LinstorCluster.v1.piraeus.io
      LinstorSatelliteConfiguration.v1.piraeus.io
    Feature ID:         Resources
    Hash:               1wfyi3zvwyp9VvpknsXhz/Pe9rtVJZxc5zNPR0ZyAJE=
    Last Applied Time:  2024-05-09T20:14:56Z
    Status:             Provisioned
    Failure Message:    failed to decode k8s resource     # This is the configuration for default images. Err: Object 'Kind' is missing in '{"base":"quay.io/piraeusdatastore","components":{"drbd-module-loader":{"image":"drbd9-jammy","match":[{"image":"drbd9-centos7","osImage":"CentOS Linux 7"},{"image":"drbd9-centos8","osImage":"CentOS Linux 8"},{"image":"drbd9-almalinux8","osImage":"AlmaLinux 8"},{"image":"drbd9-almalinux8","osImage":"Red Hat Enterprise Linux CoreOS"},{"image":"drbd9-almalinux9","osImage":"AlmaLinux 9"},{"image":"drbd9-bionic","osImage":"Ubuntu 18\\.04"},{"image":"drbd9-focal","osImage":"Ubuntu 20\\.04"},{"image":"drbd9-jammy","osImage":"Ubuntu 22\\.04"},{"image":"drbd9-bullseye","osImage":"Debian GNU/Linux 11"},{"image":"drbd9-buster","osImage":"Debian GNU/Linux 10"}],"tag":"v9.2.5"},"drbd-reactor":{"image":"drbd-reactor","tag":"v1.2.0"},"drbd-shutdown-guard":{"image":"drbd-shutdown-guard","tag":"v1.0.0"},"ha-controller":{"image":"piraeus-ha-controller","tag":"v1.1.4"},"linstor-controller":{"image":"piraeus-server","tag":"v1.24.2"},"linstor-csi":{"image":"piraeus-csi","tag":"v1.2.3"},"linstor-satellite":{"image":"piraeus-server","tag":"v1.24.2"}}}'
    Feature ID:         Helm
    Hash:               kh7/iWZBPm00cjDtAcunZwlq6uomSFd9VOSclID0uAI=
    Last Applied Time:  2024-05-09T20:18:27Z
    Status:             Provisioning
  Helm Release Summaries:
    Release Name:       linstor
    Release Namespace:  piraeus-datastore
    Status:             Managing
    Values Hash:        aW5zdGFsbENSRHM6IHRydWUK
Events:                 <none>
@thecodeassassin thecodeassassin added the bug Something isn't working label May 9, 2024
@thecodeassassin thecodeassassin changed the title BUG: Helm with yaml templates incorrectly get parsed by sveltos BUG: Helm with yaml configmap templates incorrectly get parsed by sveltos May 9, 2024
@gianlucam76 gianlucam76 self-assigned this May 10, 2024
@gianlucam76 gianlucam76 added this to the v0.29.2 milestone May 10, 2024
@gianlucam76
Copy link
Member

There was an issue processing the content piraeus-operator.
this PR fixed that issue

With that PR fixed everything is working fine and all gets deployed.

  1. git clone --branch v2 https://github.com/piraeusdatastore/piraeus-operator
  2. cd piraeus-operator
  3. edit charts/piraeus/values.yaml to set installCRDs: true
  4. helm template --include-crds charts/piraeus > /tmp/piraeus

Now that I have the data I want to deploy:

  1. kubectl create configmap piraeus --from-file=/tmp/piraeus
  2. kubectl create configmap linstorcluster --from-file=/tmp/linstorcluster (this contains LinstorCluster instance)

At this point created this ClusterProfile

apiVersion: [config.projectsveltos.io/v1alpha1](http://config.projectsveltos.io/v1alpha1)
kind: ClusterProfile
metadata:
 name: deploy-piraeus
spec:
 clusterSelector: env=fv
 policyRefs:
 - name: piraeus
  namespace: default
  kind: ConfigMap
 - name: linstorcluster
  namespace: default
  kind: ConfigMap

and all got deployed

featureSummaries:
  - deployedGroupVersionKind:
   - ServiceAccount.v1.
   - Secret.v1.
   - ConfigMap.v1.
   - [CustomResourceDefinition.v1.apiextensions.k8s.io](http://customresourcedefinition.v1.apiextensions.k8s.io/)
   - [ClusterRole.v1.rbac.authorization.k8s.io](http://clusterrole.v1.rbac.authorization.k8s.io/)
   - [ClusterRoleBinding.v1.rbac.authorization.k8s.io](http://clusterrolebinding.v1.rbac.authorization.k8s.io/)
   - [Role.v1.rbac.authorization.k8s.io](http://role.v1.rbac.authorization.k8s.io/)
   - [RoleBinding.v1.rbac.authorization.k8s.io](http://rolebinding.v1.rbac.authorization.k8s.io/)
   - Service.v1.
   - Deployment.v1.apps
   - [ValidatingWebhookConfiguration.v1.admissionregistration.k8s.io](http://validatingwebhookconfiguration.v1.admissionregistration.k8s.io/)
   - [LinstorCluster.v1.piraeus.io](http://linstorcluster.v1.piraeus.io/)
   featureID: Resources
   hash: H5ZO3dABozZ5cl99Rd++F4loJJIKoqt1uVNi6PGzShI=
   lastAppliedTime: "2024-05-10T10:44:26Z"
   status: Provisioned

@gianlucam76
Copy link
Member

Available in v0.30.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants