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

Adding a hint when the APP CR installation fails due to ca cert error #1347

Closed
wants to merge 3 commits into from

Conversation

rohitagg2020
Copy link
Contributor

What this PR does / why we need it:

Adding a hint when the APP CR installation fails due to ca certificate not present in kapp controller

Which issue(s) this PR fixes:

With this change, app status will look like this whenever there is an error because kapp controller not able to fetch because of ca cert error:

$ kubectl get app/test-https -oyaml -n kapp-controller
apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
  annotations:
    kapp.k14s.io/change-group: kappctrl-e2e.k14s.io/apps
    kapp.k14s.io/identity: v1;kapp-controller/kappctrl.k14s.io/App/test-https;kappctrl.k14s.io/v1alpha1
    creationTimestamp: "2023-10-10T17:54:17Z"
  generation: 1
  labels:
    kapp.k14s.io/app: "1696960456655542000"
    kapp.k14s.io/association: v1.6c8820c760920aa56c616f481c6e3a4f
  name: test-https
  namespace: kapp-controller
  resourceVersion: "151557"
  uid: 941ac597-2379-4be5-ba88-e2afe9d0fa7b
spec:
  deploy:
  - kapp:
      inspect: {}
      intoNs: kapp-controller
  fetch:
  - http:
      url: https://https-svc.https-server.svc.cluster.local:443/deployment.yml
  serviceAccountName: kappctrl-e2e-ns-sa
  template:
  - ytt: {}
status:
  conditions:
  - message: 'Fetching resources: Error (see .status.usefulErrorMessage for details)'
    status: "True"
    type: ReconcileFailed
  consecutiveReconcileFailures: 5
  fetch:
    error: 'Fetching resources: Error (see .status.usefulErrorMessage for details)'
    exitCode: 1
    startedAt: "2023-10-10T17:54:49Z"
    stderr: |-
      vendir: Error: Syncing directory '0':
        Syncing directory '.' with HTTP contents:
          Downloading URL:
            Initiating URL download:
              Get "https://https-svc.https-server.svc.cluster.local:443/deployment.yml": tls: failed to verify certificate: x509: certificate signed by unknown authority
      hint: The CA Certificate from URL is unknown, please add it to the kapp-controller configuration to reconcile successfully.
    updatedAt: "2023-10-10T17:54:49Z"
  friendlyDescription: 'Reconcile failed: Fetching resources: Error (see .status.usefulErrorMessage
    for details)'
  observedGeneration: 1
  usefulErrorMessage: |-
    vendir: Error: Syncing directory '0':
      Syncing directory '.' with HTTP contents:
        Downloading URL:
          Initiating URL download:
            Get "https://https-svc.https-server.svc.cluster.local:443/deployment.yml": tls: failed to verify certificate: x509: certificate signed by unknown authority
    hint: The CA Certificate from URL is unknown, please add it to the kapp-controller configuration to reconcile successfully.

Fixes #

Does this PR introduce a user-facing change?


Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


…e not present in kapp controller

Signed-off-by: rohitagg2020 <[email protected]>
…e not present in kapp controller

Signed-off-by: rohitagg2020 <[email protected]>
…pp-controller into ra-add-hint-for-cert-error
@praveenrewar praveenrewar deleted the ra-add-hint-for-cert-error branch April 29, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant