forked from TraceMachina/nativelink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the NativeLink Kubernetes operator
A single `kubectl apply -k` now deploys NativeLink in a self-configuring, self-healing and self-updating fashion. To achieve this we implement a two-stage depoyment to asynchronously reconciliate various parts of NativeLink Kustomizations. First, we deploy Flux Alerts that trigger Tekton Pipelines on GitRepository updates to bring required images into the cluster. Second, and technically at the same time, we start a Flux Kustomization to deploy a NativeLink Kustomization. This is similar to the previous 01_operations and 02_applicaion scripts, but now happens fully automated in the cluster and no longer requires a local Nix installation as all tag evaluations have become implementation details of the Tekton Pipelines. This commit also changes the K8s resource layout to a "best-practice" Kustomize directory layout. This further reduces code duplication and gives third parties greater flexibility and more useful reference points to build custom NativeLink setups. Includes an overhaul of the Kubernetes documentation.
- Loading branch information
1 parent
51a2fd4
commit 7308caa
Showing
45 changed files
with
806 additions
and
585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ Cloudflare | |
ELB | ||
GPUs | ||
Goma | ||
Kustomization | ||
[Hh]ermeticity | ||
Kustomization | ||
LLD | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
components: | ||
- ../../kubernetes/components/operator | ||
|
||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/path | ||
value: ./kubernetes/overlays/chromium | ||
target: | ||
kind: Kustomization | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/url | ||
value: https://github.com/aaronmondal/nativelink | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/ref/branch | ||
value: flux | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:TraceMachina/nativelink#nativelink-worker-siso-chromium | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-alert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
components: | ||
- ../../kubernetes/components/operator | ||
|
||
# Change this value to deploy custom overlays. | ||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/path | ||
value: ./kubernetes/overlays/lre | ||
target: | ||
kind: Kustomization | ||
name: nativelink | ||
|
||
# Modify this value to change the URL of the repository with deployment files. | ||
# | ||
# This is usually only necessary if you change deployment YAML files or | ||
# NativeLink config files. If you only intend to change the Rust sources you can | ||
# leave this as is and need to ensure that the Alerts below are patched to build | ||
# your local sources. | ||
- patch: |- | ||
- op: replace | ||
path: /spec/url | ||
value: https://github.com/aaronmondal/nativelink | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
|
||
# Patch this to change to track a custom branch. | ||
- patch: |- | ||
- op: replace | ||
path: /spec/ref/branch | ||
value: flux | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
|
||
# Setting the flake outputs to `./src_root#xxx` causes the Tekton pipelines to | ||
# build nativelink from your local sources. | ||
# | ||
# During development, the following formats might be useful as well: | ||
# | ||
# `github:user/repo#outname` to build an image from an arbitrary flake output. | ||
# | ||
# `github:TraceMachina/nativelink?ref=pull/<PR_NUMBER>/head#<OUT>` to deploy a | ||
# outputs from a Pull request. | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: ./src_root#image | ||
target: | ||
kind: Alert | ||
name: nativelink-image-alert | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: ./src_root#nativelink-worker-init | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-init-alert | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: ./src_root#nativelink-worker-lre-cc | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-alert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
components: | ||
- ../../kubernetes/components/operator | ||
|
||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/path | ||
value: ./kubernetes/overlays/lre | ||
target: | ||
kind: Kustomization | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/url | ||
value: https://github.com/aaronmondal/nativelink | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/ref/branch | ||
value: flux | ||
target: | ||
kind: GitRepository | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:aaronmondal/nativelink/flux#nativelink-worker-lre-cc | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-alert | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:aaronmondal/nativelink/flux#image | ||
target: | ||
kind: Alert | ||
name: nativelink-image-alert | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:aaronmondal/nativelink/flux#nativelink-worker-init | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-init-alert |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.