Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluxcd/kustomize-controller
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.14.1
Choose a base ref
...
head repository: fluxcd/kustomize-controller
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.15.0
Choose a head ref

Commits on Sep 10, 2021

  1. Run tests with envtest installed in testbin

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 10, 2021
    Copy the full SHA
    3cb1ce8 View commit details
  2. Refactor tests

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 10, 2021
    Copy the full SHA
    14329c6 View commit details
  3. Merge pull request #425 from fluxcd/refactor-tests

    Refactor tests
    stefanprodan authored Sep 10, 2021
    Copy the full SHA
    74f08c3 View commit details

Commits on Sep 30, 2021

  1. fix: don't skip all errors when recording health check status

    fixes #432
    
    Signed-off-by: Max Jonas Werner <mail@makk.es>
    Max Jonas Werner committed Sep 30, 2021
    Copy the full SHA
    435815c View commit details
  2. Merge pull request #435 from makkes/fix-health-checks

    fix: don't skip all errors when recording health check status
    stefanprodan authored Sep 30, 2021
    Copy the full SHA
    ea369a0 View commit details
  3. Introduce v1beta2 API

    Changes from v1beta1:
    - `spec.validation` removed (server-side validation is implicit)
    - `spec.status.snapshot` replaced by `spec.status.inventory`
    - `spec.patchesStrategicMerge` deprecated in favour of `spec.patches`
    - `spec.patchesJson6902` deprecated in favour of `spec.patches`
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    7ffe62b View commit details
  4. Add SSA resource manager

    Package ssa contains utilities for managing Kubernetes resources using sever-side apply.
    Package objectutil contains utilities for manipulating Kubernetes objects.
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    3a03d23 View commit details
  5. Remove kubectl dependency

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    79dd865 View commit details
  6. Implement reconciliation using server-side apply

    Reconciler behaviour:
    - Creates an inventory of objects to be applied (persisted in-cluster under `.status.inventory`).
    - Applies first custom resource definitions (CRDs) and namespaces, waits for them to register and only then applies the custom resources.
    - Validates all resources with server-side dry-run apply (namespaced objects must contain `metadata.namespace`, defaulting to the `default` namespace is no longer supported).
    - Reconciles only the resources that drifted.
    - Prunes the objects that were previously applied but are missing from the current inventory.
    - Emits events for only the resources that where created, configured or deleted.
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    1e01d80 View commit details
  7. Update the status when health checking starts

    Set the healthiness status to progressing and specify the health check timeout in the condition message.
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    b33e3b3 View commit details
  8. Refactor reconciliation into actions

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    69069c3 View commit details
  9. Skip finalizer pruning when impersonation fails

    When impersonation fails, emit an event with the stale objects and continue with the finalization as this is not a retryable error.
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    97bbc59 View commit details
  10. Add e2e test for CRDs+CRs reconciliation using cert-manager

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    8baead9 View commit details
  11. Implement health checking for all resources

    - Add `.spec.wait` optional boolean field to API
    - Wait for all applied resources to become ready when `.spec.wait` is set to `true`
    
    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    468f00e View commit details
  12. Add spec.wait usage to the API docs

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    9c8f284 View commit details
  13. Run SSA resource manager tests in CI

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    9c533e4 View commit details
  14. Add test for reconciling an empty source

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    64084ea View commit details
  15. Skip pruning for objects with a different owner

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Sep 30, 2021
    Copy the full SHA
    d022286 View commit details

Commits on Oct 1, 2021

  1. Use ssa package from fluxcd/pkg

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 1, 2021
    Copy the full SHA
    6346591 View commit details

Commits on Oct 4, 2021

  1. Update kustomize to v4.4.0

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 4, 2021
    Copy the full SHA
    50c7135 View commit details

Commits on Oct 6, 2021

  1. envtest: Add cancellable context to stop controllers

    In suite test, the context created by SetupSignalHandler() watches for
    shutdown signal to cancel the context. This makes it possible to stop
    the controllers by sending a kill signal that cancels the context.
    
    This change allows controller context cancellation by creating another
    context from SetupSignalHandler() context with a CancelFunc that's
    called at the end of the test, instead of sending a kill signal.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 6, 2021
    Copy the full SHA
    b7abdf2 View commit details
  2. Merge pull request #439 from darkowlzz/envtest-stop-controllers

    envtest: Add cancellable context to stop controllers
    stefanprodan authored Oct 6, 2021
    Copy the full SHA
    efd1cb4 View commit details

Commits on Oct 7, 2021

  1. Add example for .spec.wait usage

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 7, 2021
    Copy the full SHA
    dba56a5 View commit details
  2. Replace envtest with testenv

    testenv now supports provisioning users. Replace envtest with testenv.
    
    Also, reorder the cleanup to stop the test environment before stopping
    the file server to avoid anything in the cluster trying to connect to
    the file server after it's stopped.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 7, 2021
    Copy the full SHA
    dd3935c View commit details
  3. Merge pull request #441 from darkowlzz/use-testenv

    Replace envtest with testenv
    stefanprodan authored Oct 7, 2021
    Copy the full SHA
    ad2fe66 View commit details
  4. Restore spec.validation and mark it as deprecated

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 7, 2021
    Copy the full SHA
    51a7189 View commit details
  5. Merge pull request #426 from fluxcd/v1beta2

    [RFC] Server-side reconciliation for the v1beta2 API
    stefanprodan authored Oct 7, 2021
    Copy the full SHA
    5fe3ac8 View commit details
  6. Fix flapping kstatus test due to rate limits

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 7, 2021
    Copy the full SHA
    b837b8f View commit details
  7. Pin runc to fix CVE-2021-30465

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 7, 2021
    Copy the full SHA
    145b238 View commit details

Commits on Oct 8, 2021

  1. Guard against waiting deadlock

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 8, 2021
    Copy the full SHA
    652da7f View commit details
  2. Update SSA to force apply RBAC

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 8, 2021
    Copy the full SHA
    a2b816c View commit details
  3. Merge pull request #442 from fluxcd/fixes

    Various fixes
    stefanprodan authored Oct 8, 2021
    Copy the full SHA
    d4b7572 View commit details
  4. Release v0.15.0

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 8, 2021
    Copy the full SHA
    7c635c5 View commit details
  5. Merge pull request #443 from fluxcd/release-0.15.0

    Release v0.15.0
    stefanprodan authored Oct 8, 2021
    Copy the full SHA
    19d18f0 View commit details
  6. Bump image tag to v0.15.0

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Oct 8, 2021
    Copy the full SHA
    2c223b4 View commit details
  7. Merge pull request #444 from fluxcd/tag-0.15

    Bump image tag to v0.15.0
    stefanprodan authored Oct 8, 2021
    Copy the full SHA
    49fd435 View commit details
Showing with 5,351 additions and 3,287 deletions.
  1. +7 −11 .github/workflows/e2e.yaml
  2. +1 −0 .gitignore
  3. +54 −0 CHANGELOG.md
  4. +0 −14 Dockerfile
  5. +27 −6 Makefile
  6. +3 −0 PROJECT
  7. +14 −15 README.md
  8. +3 −3 api/go.mod
  9. +116 −23 api/go.sum
  10. +39 −0 api/v1beta2/condition_types.go
  11. +20 −0 api/v1beta2/doc.go
  12. +33 −0 api/v1beta2/groupversion_info.go
  13. +33 −0 api/v1beta2/inventory_types.go
  14. +362 −0 api/v1beta2/kustomization_types.go
  15. +47 −0 api/v1beta2/reference_types.go
  16. +321 −0 api/v1beta2/zz_generated.deepcopy.go
  17. +403 −0 config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml
  18. +2 −2 config/default/kustomization.yaml
  19. +0 −12 config/kubeconfig
  20. +1 −1 config/manager/kustomization.yaml
  21. +3 −11 config/samples/kustomize_v1beta1_kustomization.yaml
  22. +23 −0 config/testdata/crds-crs/cert-manager.yaml
  23. +249 −220 controllers/kustomization_controller.go
  24. +0 −606 controllers/kustomization_controller_gc_test.go
  25. +0 −247 controllers/kustomization_controller_patch_test.go
  26. +0 −194 controllers/kustomization_controller_sops_test.go
  27. +0 −563 controllers/kustomization_controller_test.go
  28. +0 −376 controllers/kustomization_controller_transformers_test.go
  29. +1 −1 controllers/kustomization_decryptor.go
  30. +141 −0 controllers/kustomization_decryptor_test.go
  31. +148 −0 controllers/kustomization_dependson_test.go
  32. +172 −0 controllers/kustomization_force_test.go
  33. +0 −205 controllers/kustomization_gc.go
  34. +14 −177 controllers/kustomization_generator.go
  35. +0 −139 controllers/kustomization_healthcheck.go
  36. +1 −24 controllers/kustomization_impersonation.go
  37. +1 −1 controllers/kustomization_indexers.go
  38. +165 −0 controllers/kustomization_inventory.go
  39. +437 −0 controllers/kustomization_prune_test.go
  40. +433 −0 controllers/kustomization_transformer_test.go
  41. +1 −1 controllers/kustomization_varsub.go
  42. +181 −0 controllers/kustomization_varsub_test.go
  43. +200 −0 controllers/kustomization_wait_test.go
  44. +285 −81 controllers/suite_test.go
  45. +1 −1 controllers/testdata/file-transformer/namespace-transformer.yaml
  46. +1 −1 controllers/testdata/transformers/kustomization.yaml
  47. +0 −92 controllers/utils.go
  48. +0 −86 controllers/utils_test.go
  49. +117 −108 docs/api/kustomize.md
  50. +24 −0 docs/spec/v1beta2/README.md
  51. +1,064 −0 docs/spec/v1beta2/kustomization.md
  52. +23 −20 go.mod
  53. +177 −44 go.sum
  54. +3 −2 main.go
18 changes: 7 additions & 11 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -30,18 +30,12 @@ jobs:
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
- name: Setup Kustomize
uses: fluxcd/pkg//actions/kustomize@main
- name: Setup Kubebuilder
uses: fluxcd/pkg//actions/kubebuilder@main
- name: Setup Kubectl
uses: fluxcd/pkg/actions/kubectl@main
with:
version: 1.21.2
- name: Override Kubebuilder kubectl
run: sudo cp /usr/local/bin/kubectl /home/runner/work/kustomize-controller/kustomize-controller/kubebuilder/bin/kubectl
- name: Run tests
- name: Run controller tests
run: make test
env:
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
@@ -51,8 +45,6 @@ jobs:
fi
- name: Build container image
run: make docker-build IMG=test/kustomize-controller:latest
env:
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
- name: Load test image
run: kind load docker-image test/kustomize-controller:latest
- name: Install CRDs
@@ -66,13 +58,12 @@ jobs:
echo -e "${RESULT}\n\ndoes not equal\n\n${EXPECTED}"
exit 1
fi
kubectl delete -f config/testdata/status-defaults
- name: Deploy controllers
run: |
make dev-deploy IMG=test/kustomize-controller:latest
kubectl -n kustomize-system rollout status deploy/source-controller --timeout=1m
kubectl -n kustomize-system rollout status deploy/kustomize-controller --timeout=1m
env:
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
- name: Run overlays tests
run: |
kubectl -n kustomize-system apply -k ./config/testdata/overlays
@@ -90,6 +81,11 @@ jobs:
kubectl -n impersonation wait kustomizations/podinfo --for=condition=ready --timeout=4m
kubectl -n impersonation delete kustomizations/podinfo
until kubectl -n impersonation get deploy/podinfo 2>&1 | grep NotFound ; do sleep 2; done
- name: Run CRDs + CRs tests
run: |
kubectl -n kustomize-system apply -f ./config/testdata/crds-crs
kubectl -n kustomize-system wait kustomizations/certs --for=condition=ready --timeout=4m
kubectl -n kustomizer-cert-test wait issuers/my-ca-issuer --for=condition=ready --timeout=1m
- name: Logs
run: |
kubectl -n kustomize-system logs deploy/source-controller
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@

# Dependency directories (remove the comment below to include it)
# vendor/
testbin/
bin/
config/release/
config/crd/bases/gitrepositories.yaml
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,60 @@

All notable changes to this project are documented in this file.

## 0.15.0

**Release date:** 2021-10-08

This prerelease comes with a [new reconciler](https://github.com/fluxcd/kustomize-controller/pull/426)
based on Kubernetes server-side apply and graduates the API to `v1beta2`.

The controller dependencies has been updated to match
kustomize [v4.4.0](https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv4.4.0)
which restores the usage of YAML anchors.

**Breaking changes**

- Namespaced objects must contain `metadata.namespace`, defaulting to the `default` namespace is no longer supported.
Setting a namespace for all objects reconciled by a Kustomization can be done with `spec.targetNamespace`.
- The logs, events and alerts that report Kubernetes namespaced object changes are
now using the `Kind/Namespace/Name` format instead of `Kind/Name`.
- The minimum required version of Kubernetes has changed to:

| Kubernetes version | Minimum required |
| --- | --- |
| `v1.16` | `>= 1.16.11` |
| `v1.17` | `>= 1.17.7` |
| `v1.18` | `>= 1.18.4` |
| `v1.19` and later | `>= 1.19.0` |

**Features and Improvements**

- Being able to validate and reconcile sources that contain both CRDs and CRs.
- Being able to wait for all the applied resources to become ready
without requiring users to fill-in the health check list.
- Improve performance (CPU, memory, network, FD usage) and reduce the number of calls to Kubernetes API
by replacing kubectl execs with a specialized applier written in Go.
- Detect and report drift between the desired state (git, s3, etc) and cluster state reliably.
- Improve the overall observably of the reconciliation process by reporting in real-time
the garbage collection and health assessment actions.
- Reconcile empty sources including pruning of all the resources previously applied.
- Mask secrets data in logs, events and alerts.

**API changes**

The `kustomize.toolkit.fluxcd.io/v1beta2` API is backwards compatible with `v1beta1`.

Additions, deprecations and removals:
- `.spec.patchesStrategicMerge` deprecated in favour of `.spec.patches`
- `.spec.patchesJson6902` deprecated in favour of `.spec.patches`
- `.spec.validation` deprecated and no longer used (server-side validation is implicit)
- `.spec.wait` added (when enabled, will wait for all the reconciled resources to become ready)
- `.status.snapshot` replaced by `.status.inventory`

Updating the manifests in Git to `v1beta2` can be done at any time after the kustomize-controller upgrade.
All users are encouraged to update the manifests as the deprecated fields
will be removed when the next API version will be released.

## 0.14.1

**Release date:** 2021-09-09
14 changes: 0 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM golang:1.16-alpine as builder

ARG TARGETPLATFORM

WORKDIR /workspace

RUN apk add --no-cache ca-certificates curl

RUN kubectl_ver=1.21.3 && \
arch=${TARGETPLATFORM:-linux/amd64} && \
if [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then arch="linux/arm"; fi && \
curl -sL https://storage.googleapis.com/kubernetes-release/release/v${kubectl_ver}/bin/${arch}/kubectl \
-o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl

RUN kubectl version --client=true

# copy api submodule
COPY api/ api/

@@ -38,7 +26,6 @@ LABEL org.opencontainers.image.source="https://github.com/fluxcd/kustomize-contr

RUN apk add --no-cache ca-certificates tini git openssh-client gnupg

COPY --from=builder /usr/local/bin/kubectl /usr/local/bin/
COPY --from=builder /workspace/kustomize-controller /usr/local/bin/

# Create minimal nsswitch.conf file to prioritize the usage of /etc/hosts over DNS queries.
@@ -50,6 +37,5 @@ RUN addgroup -S controller && adduser -S controller -G controller
USER controller

ENV GNUPGHOME=/tmp
COPY config/kubeconfig /home/controller/.kube/config

ENTRYPOINT [ "/sbin/tini", "--", "kustomize-controller" ]
33 changes: 27 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
IMG ?= fluxcd/kustomize-controller:latest
# Produce CRDs that work back to Kubernetes 1.16
CRD_OPTIONS ?= crd:crdVersions=v1
SOURCE_VER ?= v0.15.4
SOURCE_VER ?= v0.16.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -13,10 +13,16 @@ endif

all: manager

# Run tests
test: generate fmt vet manifests api-docs download-crd-deps
go test ./... -coverprofile cover.out
cd api; go test ./... -coverprofile cover.out
# Download the envtest binaries to testbin
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
ENVTEST_AKUBERNETES_VERSION=latest
install-envtest: setup-envtest
$(SETUP_ENVTEST) use $(ENVTEST_AKUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR)

# Run controller tests
KUBEBUILDER_ASSETS?="$(shell $(SETUP_ENVTEST) use -i $(ENVTEST_AKUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
test: generate fmt vet manifests api-docs download-crd-deps install-envtest
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test ./controllers/... -v -coverprofile cover.out

# Build manager binary
manager: generate fmt vet
@@ -65,7 +71,7 @@ manifests: controller-gen

# Generate API reference documentation
api-docs: gen-crd-api-reference-docs
$(API_REF_GEN) -api-dir=./api/v1beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/kustomize.md
$(API_REF_GEN) -api-dir=./api/v1beta2 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/kustomize.md

# Run go mod tidy
tidy:
@@ -130,3 +136,18 @@ API_REF_GEN=$(GOBIN)/gen-crd-api-reference-docs
else
API_REF_GEN=$(shell which gen-crd-api-reference-docs)
endif

setup-envtest:
ifeq (, $(shell which setup-envtest))
@{ \
set -e ;\
SETUP_ENVTEST_TMP_DIR=$$(mktemp -d) ;\
cd $$SETUP_ENVTEST_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-runtime/tools/setup-envtest@latest ;\
rm -rf $$SETUP_ENVTEST_TMP_DIR ;\
}
SETUP_ENVTEST=$(GOBIN)/setup-envtest
else
SETUP_ENVTEST=$(shell which setup-envtest)
endif
3 changes: 3 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
domain: toolkit.fluxcd.io
repo: github.com/fluxcd/kustomize-controller
resources:
- group: kustomize
kind: Kustomization
version: v1beta2
- group: kustomize
kind: Kustomization
version: v1beta1
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,15 +19,15 @@ Features:
* generates the `kustomization.yaml` file if needed
* generates Kubernetes manifests with kustomize build
* decrypts Kubernetes secrets with Mozilla SOPS
* validates the build output with client-side or APIServer dry-run
* validates the build output with server-side apply dry-run
* applies the generated manifests on the cluster
* prunes the Kubernetes objects removed from source
* checks the health of the deployed workloads
* runs `Kustomizations` in a specific order, taking into account the depends-on relationship
* notifies whenever a `Kustomization` status changes

Specifications:
* [API](docs/spec/v1beta1/README.md)
* [API](docs/spec/v1beta2/README.md)
* [Controller](docs/spec/README.md)

## Usage
@@ -55,7 +55,7 @@ flux install
Create a source object that points to a Git repository containing Kubernetes and Kustomize manifests:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: podinfo
@@ -88,7 +88,7 @@ kubectl -n flux-system annotate --overwrite gitrepository/podinfo reconcile.flux
Create a kustomization object that uses the git repository defined above:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: podinfo-dev
@@ -100,7 +100,6 @@ spec:
sourceRef:
kind: GitRepository
name: podinfo
validation: client
healthChecks:
- kind: Deployment
name: frontend
@@ -147,12 +146,12 @@ kubectl -n flux-system logs deploy/kustomize-controller | jq .
"kustomization": "flux-system/podinfo-dev",
"output": {
"namespace/dev": "created",
"service/frontend": "created",
"deployment.apps/frontend": "created",
"horizontalpodautoscaler.autoscaling/frontend": "created",
"service/backend": "created",
"deployment.apps/backend": "created",
"horizontalpodautoscaler.autoscaling/backend": "created"
"service/dev/frontend": "created",
"deployment/dev/frontend": "created",
"horizontalpodautoscaler/dev/frontend": "created",
"service/dev/backend": "created",
"deployment/dev/backend": "created",
"horizontalpodautoscaler/dev/backend": "created"
}
}
```
@@ -182,7 +181,7 @@ status:
```json
{
"kustomization": "flux-system/podinfo-dev",
"error": "Error from server (NotFound): error when creating podinfo-dev.yaml: namespaces dev not found"
"error": "Error when creating 'Service/dev/frontend': namespaces dev not found"
}
```

@@ -195,7 +194,7 @@ When combined with health assessment, a kustomization will run after all its dep
For example, a service mesh proxy injector should be running before deploying applications inside the mesh:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: istio
@@ -212,7 +211,7 @@ spec:
namespace: istio-system
timeout: 2m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: podinfo-dev
@@ -251,7 +250,7 @@ that matches the semver range.
Create a production kustomization and reference the git source that follows the latest semver release:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: podinfo-production
6 changes: 3 additions & 3 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ require (
github.com/fluxcd/pkg/apis/kustomize v0.2.0
github.com/fluxcd/pkg/apis/meta v0.10.0
github.com/fluxcd/pkg/runtime v0.12.0
k8s.io/apiextensions-apiserver v0.21.3
k8s.io/apimachinery v0.21.3
sigs.k8s.io/controller-runtime v0.9.5
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
sigs.k8s.io/controller-runtime v0.10.1
)
Loading