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

nodeSelector not working for webhookConfiguration #732

Open
martinspaniol opened this issue Jan 3, 2025 · 0 comments
Open

nodeSelector not working for webhookConfiguration #732

martinspaniol opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@martinspaniol
Copy link

Describe the bug
I install akri with this command:

helm install akri akri-helm-charts/akri \
  --set useLatestContainers=true \
  --set-string agent.nodeSelectors.worker="true"  \
  --set-string webhookConfiguration.nodeSelectors.worker="true"

Note: I need to use --set-string here to make "true" (a boolean value) work as a string

Result

Error: INSTALLATION FAILED: YAML parse error on akri/templates/webhook-configuration.yaml: error converting YAML to JSON: yaml: line 121: did not find expected key

Possible reason
I looked into the webhook-configuration.yaml. The nodeSelector is in line 110:

          nodeSelector:
            {{- if .Values.webhookConfiguration.nodeSelectors }}
              {{- toYaml .Values.webhookConfiguration.nodeSelectors | nindent 8 }}
            {{- end }}
            # ...
            {{- end }}

The value has an indent of 8 and I think that's the reason. Shouldn't it be 12?

I also checked with the template command. Executing this:

helm template akri akri-helm-charts/akri   \
  --set useLatestContainers=true \
  --set-string agent.nodeSelectors.worker="true" \
  --set-string webhookConfiguration.nodeSelectors.worker="true" \
  --debug

results in:

# Source: akri/templates/webhook-configuration.yaml

apiVersion: v1
kind: List
metadata:
  name: akri-webhook-configuration
  labels:
    helm.sh/chart: akri-0.13.8
    app.kubernetes.io/part-of: akri
    app.kubernetes.io/instance: akri
    app.kubernetes.io/version: "0.13.8"
    app.kubernetes.io/managed-by: Helm
items:
  - apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: akri-webhook-configuration
      namespace: default
      labels:
        helm.sh/chart: akri-0.13.8
        app.kubernetes.io/part-of: akri
        app.kubernetes.io/instance: akri
        app.kubernetes.io/version: "0.13.8"
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: akri-webhook-configuration
        app.kubernetes.io/component: admission-webhook
  - apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata:
      name: akri-webhook-configuration
      namespace: default
      labels:
        helm.sh/chart: akri-0.13.8
        app.kubernetes.io/part-of: akri
        app.kubernetes.io/instance: akri
        app.kubernetes.io/version: "0.13.8"
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: akri-webhook-configuration
        app.kubernetes.io/component: admission-webhook
    rules:
    - apiGroups: [""]
      resources: ["pods"]
      verbs: ["get"]
  - apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
      name: akri-webhook-configuration
      namespace: default
      labels:
        helm.sh/chart: akri-0.13.8
        app.kubernetes.io/part-of: akri
        app.kubernetes.io/instance: akri
        app.kubernetes.io/version: "0.13.8"
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: akri-webhook-configuration
        app.kubernetes.io/component: admission-webhook
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: Role
      name: akri-webhook-configuration
    subjects:
    - kind: ServiceAccount
      name: akri-webhook-configuration
      namespace: default
  - apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: akri-webhook-configuration
      labels:
        helm.sh/chart: akri-0.13.8
        app.kubernetes.io/part-of: akri
        app.kubernetes.io/instance: akri
        app.kubernetes.io/version: "0.13.8"
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: akri-webhook-configuration
        app.kubernetes.io/component: admission-webhook
    spec:
      replicas: 1
      selector:
        matchLabels:
          app.kubernetes.io/part-of: akri
          app.kubernetes.io/instance: akri
          app.kubernetes.io/name: akri-webhook-configuration
      template:
        metadata:
          labels:
            helm.sh/chart: akri-0.13.8
            app.kubernetes.io/part-of: akri
            app.kubernetes.io/instance: akri
            app.kubernetes.io/version: "0.13.8"
            app.kubernetes.io/managed-by: Helm
            app.kubernetes.io/name: akri-webhook-configuration
            app.kubernetes.io/component: admission-webhook
        spec:
          serviceAccountName: akri-webhook-configuration
          containers:
          - name: webhook
            image: "ghcr.io/project-akri/akri/webhook-configuration:latest"
            imagePullPolicy: Always
            resources:
              requests:
                memory: 100Mi
                cpu: 15m
              limits:
                memory: 100Mi
                cpu: 26m
            args:
            - --tls-crt-file=/secrets/tls.crt
            - --tls-key-file=/secrets/tls.key
            - --port=8443
            volumeMounts:
            - name: secrets
              mountPath: /secrets
              readOnly: true
          volumes:
            - name: secrets
              secret:
                secretName: akri-webhook-configuration
          tolerations:
            - key: node-role.kubernetes.io/master
              effect: NoSchedule
          nodeSelector:
        worker: "true" # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this seems wrong
            "kubernetes.io/os": linux

Take note of the second last line with the nodeSelector.

@martinspaniol martinspaniol added the bug Something isn't working label Jan 3, 2025
@github-project-automation github-project-automation bot moved this to Triage needed in Akri Roadmap Jan 3, 2025
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
Status: Triage needed
Development

No branches or pull requests

1 participant