0

I am installing flux on AKS cluster and synch it with my private GitHub repo, not attached to organization to clearly narrow down if it is a certificates issue.

First thing first I performed is flux bootstrap! and it worked well. Unfortunately, when I try to create a flux binding to GitHub repo to install the helm chart then no fun.

flux bootstrap github --owner=$GITHUB_USER --repository=container-label-webhook --path=dev-cluster

✔ Kustomization reconciled successfully
► confirming components are healthy
✔ helm-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ notification-controller: deployment ready
✔ source-controller: deployment ready
✔ all components are healthy

Now, I try to deploy my application by telling flux the location of my helm charts as like below:

flux create source helm label-webhook --url https://github.com/ameyaagashe/container-label-webhook/tree/main/chart --namespace label-webhook
✚ generating HelmRepository source
► applying HelmRepository source
✔ source created
◎ waiting for HelmRepository source reconciliation
✗ failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found

Seeing the above failure I tried to grab some more information. But I am not able to understand what is the exact issue for the error message, no artifact for resource in storage

k get helmrepository -A
NAMESPACE       NAME            URL                                                                      AGE     READY   STATUS
label-webhook   label-webhook   https://github.com/ameyaagashe/container-label-webhook/tree/main/chart   4m11s   False   failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
kubectl describe helmrepository label-webhook -nlabel-webhook
    Manager:      flux
    Operation:    Update
    Time:         2022-08-06T13:44:29Z
    API Version:  source.toolkit.fluxcd.io/v1beta2
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:finalizers:
          .:
          v:"finalizers.fluxcd.io":
    Manager:      source-controller
    Operation:    Update
    Time:         2022-08-06T13:44:29Z
    API Version:  source.toolkit.fluxcd.io/v1beta2
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        f:conditions:
    Manager:         source-controller
    Operation:       Update
    Subresource:     status
    Time:            2022-08-06T13:44:30Z
  Resource Version:  765159
  UID:               bae98a22-7608-4af2-8ff5-5bf05ce98ba4
Spec:
  Interval:  1m0s
  Timeout:   60s
  URL:       https://github.com/ameyaagashe/container-label-webhook/tree/main/chart
Status:
  Conditions:
    Last Transition Time:  2022-08-06T13:44:30Z
    Message:               no artifact for resource in storage
    Observed Generation:   1
    Reason:                NoArtifact
    Status:                True
    Type:                  Reconciling
    Last Transition Time:  2022-08-06T13:44:30Z
    Message:               failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
    Observed Generation:   1
    Reason:                Failed
    Status:                False
    Type:                  Ready
    Last Transition Time:  2022-08-06T13:44:30Z
    Message:               failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
    Observed Generation:   1
    Reason:                Failed
    Status:                True
    Type:                  FetchFailed
  Observed Generation:     -1
Events:
  Type     Reason  Age                   From               Message
  ----     ------  ----                  ----               -------
  Warning  Failed  2m1s (x8 over 5m12s)  source-controller  failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found

I appreciate the app I am trying to get deployed needs ca cert, key file and ca bundle so I tried with all those options as like below: I get the same X509 cert error even with Normal Github.com not the Enterprise one, this is crazy....

flux create source helm label-webhook --url https://github.com/ameyaagashe/container-label-webhook/tree/main/chart --namespace label-webhook --cert-file=./tls/label-webhook.pem --key-file=./tls/label-webhook-key.pem --ca-file=./tls/ca.pem
✚ generating HelmRepository source
► applying secret with repository credentials
✔ authentication configured
► applying HelmRepository source
✔ source updated
◎ waiting for HelmRepository source reconciliation
✗ failed to fetch Helm repository index: failed to cache index to temporary file: Get "https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml": x509: certificate signed by unknown authority

Trying to fetch logs from kubectl describe helrmepository command:

azureuser@devvm:~/ameyaagashe/container-label-webhook$ k get helmrepository -A
NAMESPACE       NAME            URL                                                                      AGE   READY   STATUS
label-webhook   label-webhook   https://github.com/ameyaagashe/container-label-webhook/tree/main/chart   58m   False   failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
azureuser@devvm:~/ameyaagashe/container-label-webhook$ kubectl describe helmrepository label-webhook -nlabel-webhook

    Manager:      source-controller
    Operation:    Update
    Subresource:  status
    Time:         2022-08-06T13:44:30Z
    API Version:  source.toolkit.fluxcd.io/v1beta2
    Fields Type:  FieldsV1
    fieldsV1:
      f:spec:
        .:
        f:interval:
        f:timeout:
        f:url:
    Manager:         flux
    Operation:       Update
    Time:            2022-08-06T14:06:16Z
  Resource Version:  773506
  UID:               bae98a22-7608-4af2-8ff5-5bf05ce98ba4
Spec:
  Interval:  1m0s
  Timeout:   60s
  URL:       https://github.com/ameyaagashe/container-label-webhook/tree/main/chart
Status:
  Conditions:
    Last Transition Time:  2022-08-06T13:44:30Z
    Message:               no artifact for resource in storage
    Observed Generation:   3
    Reason:                NoArtifact
    Status:                True
    Type:                  Reconciling
    Last Transition Time:  2022-08-06T14:06:58Z
    Message:               failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
    Observed Generation:   3
    Reason:                Failed
    Status:                False
    Type:                  Ready
    Last Transition Time:  2022-08-06T14:06:58Z
    Message:               failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found
    Observed Generation:   3
    Reason:                Failed
    Status:                True
    Type:                  FetchFailed
  Observed Generation:     -1
Events:
  Type     Reason  Age                   From               Message
  ----     ------  ----                  ----               -------
  Warning  Failed  37m                   source-controller  failed to fetch Helm repository index: failed to cache index to temporary file: Get "https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml": x509: certificate signed by unknown authority
  Warning  Failed  3m14s (x14 over 58m)  source-controller  failed to fetch Helm repository index: failed to cache index to temporary file: failed to fetch https://github.com/ameyaagashe/container-label-webhook/tree/main/chart/index.yaml : 404 Not Found

Anyone has deployed app via their private Github repo before?

  • It might be, that the error message is a bit misleading. Actually, if you authenticate to private repo there is a missing private key reference (or I don't see it in your example). Something like: flux create secret git podinfo-auth \ --url=ssh://git@github.com/stefanprodan/podinfo \ --private-key-file=./identity see: https://fluxcd.io/flux/components/source/gitrepositories/ – aholbreich Jun 18 '23 at 16:08

1 Answers1

0

I have, no issues. Follow instructions here https://www.opcito.com/blogs/creating-helm-repository-using-github-pages. You need to create the index file and get the correct url for you helm repository.

Gabby
  • 1
  • 1