source-controller icon indicating copy to clipboard operation
source-controller copied to clipboard

Private git repositories token based auth

Open DiptoChakrabarty opened this issue 4 years ago • 2 comments

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.

DiptoChakrabarty avatar Mar 28 '21 18:03 DiptoChakrabarty

I am also running into the same thing, very similar setup, version 0.8.0 of Flux

aw185176 avatar Sep 23 '21 00:09 aw185176

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?

pjbgf avatar May 27 '22 22:05 pjbgf