Description
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.