This topic tells you how to install Flux CD Source Controller from the Tanzu Application Platform (commonly known as TAP) package repository.
NoteFollow the steps in this topic if you do not want to use a profile to install Flux CD Source Controller. For more information about profiles, see Components and installation profiles.
Before installing Flux CD Source Controller:
The Flux CD Source Controller package has no configuration values.
To install Flux CD Source Controller from the Tanzu Application Platform package repository:
List version information for the package by running:
tanzu package available list fluxcd.source.controller.tanzu.vmware.com -n tap-install
For example:
$ tanzu package available list fluxcd.source.controller.tanzu.vmware.com -n tap-install
\ Retrieving package versions for fluxcd.source.controller.tanzu.vmware.com...
NAME VERSION RELEASED-AT
fluxcd.source.controller.tanzu.vmware.com 0.16.0 2021-10-27 19:00:00 -0500 -05
Install the package by running:
tanzu package install fluxcd-source-controller -p fluxcd.source.controller.tanzu.vmware.com -v VERSION-NUMBER -n tap-install
Where:
VERSION-NUMBER
is the version of the package listed in step 1.For example:
tanzu package install fluxcd-source-controller -p fluxcd.source.controller.tanzu.vmware.com -v 0.16.0 -n tap-install
\ Installing package 'fluxcd.source.controller.tanzu.vmware.com'
| Getting package metadata for 'fluxcd.source.controller.tanzu.vmware.com'
| Creating service account 'fluxcd-source-controller-tap-install-sa'
| Creating cluster admin role 'fluxcd-source-controller-tap-install-cluster-role'
| Creating cluster role binding 'fluxcd-source-controller-tap-install-cluster-rolebinding'
| Creating package resource
- Waiting for 'PackageInstall' reconciliation for 'fluxcd-source-controller'
| 'PackageInstall' resource install status: Reconciling
Added installed package 'fluxcd-source-controller'
This package creates a new namespace called flux-system
. This namespace hosts all the elements of fluxcd.
Verify the package install by running:
tanzu package installed get fluxcd-source-controller -n tap-install
For example:
tanzu package installed get fluxcd-source-controller -n tap-install
\ Retrieving installation details for fluxcd-source-controller...
NAME: fluxcd-source-controller
PACKAGE-NAME: fluxcd.source.controller.tanzu.vmware.com
PACKAGE-VERSION: 0.16.0
STATUS: Reconcile succeeded
CONDITIONS: [{ReconcileSucceeded True }]
USEFUL-ERROR-MESSAGE:
Verify that STATUS
is Reconcile succeeded
.
kubectl get pods -n flux-system
For example:
$ kubectl get pods -n flux-system
NAME READY STATUS RESTARTS AGE
source-controller-69859f545d-ll8fj 1/1 Running 0 3m38s
Verify that STATUS
is Running
.
Verify the main components of fluxcd-source-controller
were installed by running:
kubectl get all -n flux-system
Expect to see the following outputs or similar:
NAME READY STATUS RESTARTS AGE
pod/source-controller-7684c85659-2zfxb 1/1 Running 0 40m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/source-controller ClusterIP 10.108.138.74 <none> 80/TCP 40m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/source-controller 1/1 1 1 40m
NAME DESIRED CURRENT READY AGE
replicaset.apps/source-controller-7684c85659 1 1 1 40m
Verify all the CRD were installedby running:
kubectl get crds -n flux-system | grep ".fluxcd.io"
buckets.source.toolkit.fluxcd.io 2022-03-07T19:20:14Z
gitrepositories.source.toolkit.fluxcd.io 2022-03-07T19:20:14Z
helmcharts.source.toolkit.fluxcd.io 2022-03-07T19:20:14Z
helmrepositories.source.toolkit.fluxcd.io 2022-03-07T19:20:14Z
NoteYou will communicate with
fluxcd-source-controller
through its CRDs.
If you are using a Git repository with a custom CA certificate, provide this certificate to the Flux CD Source Controller directly by including the CA in the service account used by the supply chain.
The Tanzu Application Platform distribution of Flux CD Source Controller does not support the Tanzu Application Platform shared.ca_cert_data
field. For more information about setting the CA in the service account, see Use Git authentication with Supply Chain Choreographer.
Follow these steps to consume a GitRepository
object:
Create the following gitrepository-sample.yaml
file:
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: gitrepository-sample
spec:
interval: 1m
url: https://github.com/vmware-tanzu/application-accelerator-samples
ref:
branch: main
Apply the created conf:
kubectl apply -f gitrepository-sample.yaml
gitrepository.source.toolkit.fluxcd.io/gitrepository-sample created
Verify the git-repository was fetched correctly:
kubectl get GitRepository
NAME URL READY STATUS AGE
gitrepository-sample https://github.com/vmware-tanzu/application-accelerator-samples True Fetched revision: main/132f4e719209eb10b9485302f8593fc0e680f4fc 4s
For more examples, see the samples directory on fluxcd/source-controller/samples in GitHub.
For documentation specific to fluxcd-source-controller, see the main repository fluxcd/source-controller in GitHub.