source-controller
source-controller copied to clipboard
Private git repositories token based auth
Https based authentication is not working for a private repository using the flux and kustomize controller. These are the files I have written and using
(gitinfo.yml file) apiVersion: source.toolkit.fluxcd.io/v1beta1 kind: GitRepository metadata: name: gitinfo namespace: flux spec: interval: 1m url: https://github.com/DiptoChakrabarty/order-microservice secretRef: name: token
(secret file) apiVersion: v1 kind: Secret metadata: name: token namespace: flux type: Opaque data: username: Username encoded in base64 password: github token encoded in base64
(kustomization file) apiVersion: kustomize.toolkit.fluxcd.io/v1beta1 kind: Kustomization metadata: name: gitinfo-test namespace: flux spec: interval: 5m path: "./flux/env/dev" prune: true sourceRef: kind: GitRepository name: gitinfo validation: client timeout: 80s
However I always get this error when I execute the command kubectl get gitrepository -n flux unable to clone 'https://github.com/DiptoChakrabarty/order-microservice', error: authentication required.
I am also running into the same thing, very similar setup, version 0.8.0 of Flux
There has been a ton of changes in our Git implementation since this was first reported. Have you tested it with the latest versions?
Is this still hapenning? If so, would you mind sharing what is the Git server being used?