Ravindra BagaleCourses & study guides मराठी

Chapter 96: Flux GitOps — Sources, Reconciliation and Safe Local Practice

DevOps

96.4 GitRepository, artifacts and other source types

Fictional teaching story. At a fictional Kolhapur workshop, Sana and Noah first check whether the correct lesson folder arrived before blaming the workshop instructions.

Why

Application reconciliation depends on the correct source content being available.

What

Read an explicit branch and distinguish downloading from applying.

How

GitRepository, artifacts and other source types
Original classroom diagram: GitRepository, artifacts and other source types

A GitRepository source

A GitRepository describes a Git source for source-controller. An interval is a requested periodic check duration. An artifact is the fetched snapshot made available to consumers; fetching it does not apply its files.

Immediate practice example

  1. Read the example from top to bottom. Do not send it to a real cluster.
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: classroom
  namespace: flux-system
spec:
  interval: 1m
  url: https://git.example.invalid/classroom.git
  ref:
    branch: main
  1. Read the expected result.

Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.

No source was fetched. If a real valid source were reconciled, its status would describe the artifact and revision.
  1. Understand each line in plain English.

apiVersion and kind select the fetched documented API. The metadata names the object in a namespace, a Kubernetes naming scope. interval: 1m means one minute. url is deliberately non-working. ref.branch explicitly selects main instead of relying on a default. Do not paste a real private URL or credential into this lesson.

OCIRepository and Bucket are source alternatives

An OCIRepository sources content packaged as an OCI artifact, a registry-distributed package format. A Bucket sources object-storage content. They are not Git branches and do not all use GitRepository fields.

Immediate practice example

  1. Read the example from top to bottom. Do not send it to a real cluster.
GitRepository -> reviewed Git tree snapshot
OCIRepository -> selected OCI artifact
Bucket -> selected object-storage content
  1. Read the expected result.

Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.

A consumer can refer to a supported source kind instead of assuming everything is a Git clone.
  1. Understand each line in plain English.

Each line identifies the origin and artifact role, not an interchangeable manifest schema. The fetched Kustomization documentation lists these source kinds. Exact registry, authentication, signature and bucket configuration must be reviewed separately. No registry, bucket, identity or remote service is created here.

Ravindra Bagale's Tip

A source can be ready while its application still fails.

Did you understand? Let us try it once more.