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

When specifying values in the Helm chart, the installation fails. #471

Closed
YusukeSugiyamaTG opened this issue Oct 3, 2024 · 6 comments · Fixed by #474
Closed

When specifying values in the Helm chart, the installation fails. #471

YusukeSugiyamaTG opened this issue Oct 3, 2024 · 6 comments · Fixed by #474
Labels
bug Something isn't working helm

Comments

@YusukeSugiyamaTG
Copy link

Brief summary

When using Argo CD and Helm chart for installation, specifying tolerations and affinity as follows will cause an error.

repoURL: https://grafana.github.io/helm-charts
chart: k6-operator
targetRevision: 3.9.0
helm:
  releaseName: k6-operator
  valuesObject:
    tolerations:
      - key: "dedicated"
        operator: "Equal"
        value: "platform"
        effect: "NoSchedule"
    affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
            - matchExpressions:
                - key: service-name
                  operator: In
                  values:
                    - platform

Error details

Error: values don't meet the specifications of the schema(s) in the following chart(s): k6-operator: - tolerations: Invalid type. Expected: object, given: array - affinity: Additional property nodeAffinity is not allowed - affinity: Additional property podAntiAffinity is not allowed

I think that values.schema.json was added with this upgrade.

735f875#diff-5b1691e101964ac9ed5929dabe795fa6d9a722e062c88d3245e23a06b76a6317R5

    "affinity": {
      "additionalProperties": false,
      "description": "affinity -- Affinity to be applied on all containers",
      "title": "affinity",
      "type": "object"
    },

    "tolerations": {
      "additionalProperties": false,
      "description": "tolerations -- Tolerations to be applied on all containers",
      "title": "tolerations",
      "type": "object"
    }

Here, the additionalProperties of affinity is set to false, so it seems that additional elements cannot be specified in affinity.
Regarding tolerations, it seems to be a pure type error.

k6-operator version or image

0.0.17

Helm chart version (if applicable)

3.9.0

TestRun / PrivateLoadZone YAML

This does not apply in this case.

Other environment details (if applicable)

No response

Steps to reproduce the problem

The following definition and execution in the application.yaml file of Argo CD will cause an error.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  finalizers:
    - resources-finalizer.argocd.argoproj.io
  name: k6-operator
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://grafana.github.io/helm-charts
    chart: k6-operator
    targetRevision: 3.9.0
    helm:
      releaseName: k6-operator
      valuesObject:
        tolerations:
          - key: "dedicated"
            operator: "Equal"
            value: "platform"
            effect: "NoSchedule"
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
                - matchExpressions:
                    - key: service-name
                      operator: In
                      values:
                        - platform
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
              - weight: 100
                podAffinityTerm:
                  labelSelector:
                    matchExpressions:
                      - key: app.kubernetes.io/name
                        operator: In
                        values:
                          - k6-operator
                  topologyKey: topology.kubernetes.io/zone
  destination:
    namespace: k6-operator-system
    server: https://kubernetes.default.svc

Expected behaviour

Using the application.yaml mentioned above, I expect that the installation will be completed successfully with Argo CD and Helm chart.

Actual behaviour

As mentioned above, the following error occurs.

Error details

Error: values don't meet the specifications of the schema(s) in the following chart(s): k6-operator: - tolerations: Invalid type. Expected: object, given: array - affinity: Additional property nodeAffinity is not allowed - affinity: Additional property podAntiAffinity is not allowed

@YusukeSugiyamaTG YusukeSugiyamaTG added the bug Something isn't working label Oct 3, 2024
@yorugac
Copy link
Collaborator

yorugac commented Oct 4, 2024

Hi @YusukeSugiyamaTG, yes, it seems the schema file is incorrect after all 😞 It was added on the request for the specific use case and locally it seemed to work, AFAIR. Thanks for the report!

I'll need to look into this, perhaps even remove the schema file completely if it causes such problems. Meanwhile, I believe you can just switch off the schema step with --skip-schema-validation.

@yorugac yorugac added the helm label Oct 4, 2024
@yorugac
Copy link
Collaborator

yorugac commented Oct 4, 2024

The quickest way to repeat this (without ArgoCD): install Helm as per instructions, providing values.yaml with affinity and tolerations, etc.

@YusukeSugiyamaTG
Copy link
Author

Hi @yorugac , thank you very much for your response. As you suggested, I will try using the --skip-schema-validation option and following the instructions. I would be very happy if it worked on Argo CD, so I would be grateful if you could consider it.

@yorugac
Copy link
Collaborator

yorugac commented Oct 31, 2024

Re-opening for now: most of the fixes were done in #474
But there is still a fix for tolerations left, a WIP in #481

@yorugac
Copy link
Collaborator

yorugac commented Nov 1, 2024

Fix for tolerations was merged. And a new Helm release was just made:
https://github.com/grafana/helm-charts/releases/tag/helm-k6-operator-3.9.1
With that, closing this issue 🤞

@yorugac yorugac closed this as completed Nov 1, 2024
@YusukeSugiyamaTG
Copy link
Author

@yorugac Thank you!! 😄

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

Successfully merging a pull request may close this issue.

2 participants