Git Product home page Git Product logo

Comments (7)

cppforlife avatar cppforlife commented on July 21, 2024

im not sure i understand what error you are encountering. len(...) > 0 and ... != "" is the same thing. how does your App CR look like?

from kapp-controller.

Arttii avatar Arttii commented on July 21, 2024

Ya sorry, I was not very clear. For this app CR

apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
  name: ds-tools-jupyterhub
  namespace: default
spec:
  serviceAccountName: cluster-admin-sa
  fetch:
  - image:
        # Docker image url; unqualified, tagged, or
        # digest references supported (required)
        url: docker/image
        # secret with auth details (optional)
        secretRef:
          name: auth
        subPath: ds-tools/jupyterhub
  template:
  - ytt:
        ignoreUnknownComments: true
        strict: false
  deploy:
  - kapp: {}

The len condition evaluates to true, even though no GenericOpt is set. This leads to the kapp cmd environment containing KAPP_KUBECONFIG_YAML="", which leads to the kapp deploy exiting with something like mapping values are not allowed in this context. This does not happen when using the 0.6 version.

from kapp-controller.

cppforlife avatar cppforlife commented on July 21, 2024

could you include full error message you see in status section?

from kapp-controller.

Arttii avatar Arttii commented on July 21, 2024
kind: App
apiVersion: kappctrl.k14s.io/v1alpha1
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"kappctrl.k14s.io/v1alpha1","kind":"App","metadata":{"annotations":{},"name":"ds-tools-jupyterhub","namespace":"default"},"spec":{"deploy":[{"kapp":{}}],"fetch":[{"image":{"secretRef":{"name":"auth"},"subPath":"ds-tools/jupyterhub","url":"docker/image:master.1ef0f8a30ca6d4323d5e7436eae61cc93a466188"}}],"serviceAccountName":"cluster-admin-sa","template":[{"ytt":{"ignoreUnknownComments":true,"strict":false}}]}}
  creationTimestamp: '2020-08-06T13:39:02Z'
  finalizers:
    - finalizers.kapp-ctrl.k14s.io/delete
  generation: 2
  managedFields:
    - apiVersion: kappctrl.k14s.io/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:kubectl.kubernetes.io/last-applied-configuration': {}
        'f:spec':
          .: {}
          'f:deploy': {}
          'f:fetch': {}
          'f:serviceAccountName': {}
      manager: kubectl
      operation: Update
      time: '2020-08-06T13:39:02Z'
    - apiVersion: kappctrl.k14s.io/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:finalizers': {}
        'f:spec':
          'f:template': {}
        'f:status':
          .: {}
          'f:conditions': {}
          'f:deploy':
            .: {}
            'f:error': {}
            'f:exitCode': {}
            'f:finished': {}
            'f:startedAt': {}
            'f:stderr': {}
            'f:updatedAt': {}
          'f:fetch':
            .: {}
            'f:exitCode': {}
            'f:startedAt': {}
            'f:updatedAt': {}
          'f:friendlyDescription': {}
          'f:inspect':
            .: {}
            'f:error': {}
            'f:exitCode': {}
            'f:stderr': {}
            'f:updatedAt': {}
          'f:observedGeneration': {}
          'f:template':
            .: {}
            'f:exitCode': {}
            'f:updatedAt': {}
      manager: __debug_bin
      operation: Update
      time: '2020-08-06T13:40:36Z'
  name: ds-tools-jupyterhub
  namespace: default
  resourceVersion: '19018'
  selfLink: /apis/kappctrl.k14s.io/v1alpha1/namespaces/default/apps/ds-tools-jupyterhub
  uid: f6079c24-3ff5-4745-a356-9f31a634951b
spec:
  deploy:
    - kapp: {}
  fetch:
    - image:
        secretRef:
          name: auth
        subPath: ds-tools/jupyterhub
        url: >-
         docker/image:master.1ef0f8a30ca6d4323d5e7436eae61cc93a466188
  serviceAccountName: cluster-admin-sa
  template:
    - ytt:
        ignoreUnknownComments: true
status:
  conditions:
    - message: 'Deploying: exit status 1'
      status: 'True'
      type: ReconcileFailed
  deploy:
    error: 'Deploying: exit status 1'
    exitCode: 1
    finished: true
    startedAt: '2020-08-06T13:40:25Z'
    stderr: 'kapp: Error: yaml: line 8: mapping values are not allowed in this context'
    updatedAt: '2020-08-06T13:40:36Z'
  fetch:
    exitCode: 0
    startedAt: '2020-08-06T13:40:23Z'
    updatedAt: '2020-08-06T13:40:24Z'
  friendlyDescription: 'Reconcile failed: Deploying: exit status 1'
  inspect:
    error: 'Inspecting: exit status 1'
    exitCode: 1
    stderr: 'kapp: Error: yaml: line 8: mapping values are not allowed in this context'
    updatedAt: '2020-08-06T13:40:36Z'
  observedGeneration: 2
  template:
    exitCode: 0
    updatedAt: '2020-08-06T13:40:25Z'

from kapp-controller.

cppforlife avatar cppforlife commented on July 21, 2024

hmm interesting, i dont think it's being set to empty because error message kapp: Error: yaml: line 8: mapping values are not allowed in this context says line 8, so there is definitely some yaml. since you are using spec.serviceAccountName kapp-controller uses this template for building kuebconfig: https://github.com/k14s/kapp-controller/blob/develop/pkg/deploy/service_accounts.go#L77-L97. closes to line 8 is ca certificate interpolation, but that's base64 encoded...

The len condition evaluates to true, even though no GenericOpt is set.

that's not possible. if there is no genericopt then genericopt.KubeconfigYAML would be empty which would not make len evaluate to true.

did you modify kapp-controller in some way? if yes, could you print generated kubeconfig yaml before its sent to kapp? is it a valid yaml? im not seeing yet how you are ending up with invalid yaml.

from kapp-controller.

cppforlife avatar cppforlife commented on July 21, 2024

(happy to zoom to debug as well if you want, just pop into our #k14s channel in Kubernetes slack)

from kapp-controller.

Arttii avatar Arttii commented on July 21, 2024

Thanks for the support. I was testing in a k3s cluster and after a teardown and reinit the error vanished

from kapp-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.