components

package
v0.0.0-...-ac4ca57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddComponent

func AddComponent[C Component](
	ctx *pulumi.Context,
	name string,
	component C,
) ([]pulumi.Resource, error)

AddComponent adds a component to the cluster.

func Check

func Check(_ []pulumi.Resource, err error)

Check may be usedd as convenience wrapper to error-check component creation.

Types

type Cilium

type Cilium struct {
	Version string
}

Configuration for a Cilium deployment.

func (*Cilium) Install

func (component *Cilium) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs Cilium on the cluster.

type Component

type Component interface {
	Install(ctx *pulumi.Context, name string) ([]pulumi.Resource, error)
}

A generic Component type used by all components.

type Flux

type Flux struct {
	Version string
}

The configuration for Flux.

func (*Flux) Install

func (component *Flux) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install sets up Flux in the cluster.

type Gateway

type Gateway struct {
	ExternalPort int
	InternalPort int
	Routes       []RouteConfig
}

type InternalGateway

type InternalGateway struct {
	Name  string
	IP    string
	HTTP2 bool
}

Gateway struct to hold name and IP.

type InternalGatewaysData

type InternalGatewaysData struct {
	InternalGateways []InternalGateway
	Gateways         []Gateway
}

GatewaysData struct to hold multiple Gateways for templating.

type Loadbalancer

type Loadbalancer struct {
	Gateways     []Gateway
	Dependencies []pulumi.Resource
}

A local loadbalancer.

func (*Loadbalancer) Install

func (component *Loadbalancer) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs a local loadbalancer on docker and makes it available to the kind cluster.

type LocalPVAndPVC

type LocalPVAndPVC struct {
	Size     string
	HostPath string
}

Configuration to create a PV and PVC which mount a node-local directory via `hostPath`.

func (*LocalPVAndPVC) Install

func (component *LocalPVAndPVC) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs the PV and PVC from a `LocalPVAndPVC` config.

type NativeLinkGateways

type NativeLinkGateways struct {
	Dependencies []pulumi.Resource
}

func (*NativeLinkGateways) Install

func (component *NativeLinkGateways) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install sets up the Gateways for the NativeLink deployment.

Contrary to the rest of the NativeLink setup, these gateways aren't part of the regular deployment. Recreating the Gateways would change their local IPs which makes development less convenient. Instead, we create them once and take the IPs for granted to be fixed after initial creation.

It's unclear whether this indirection is the right approach and we might add them to the regular deployments when more infrastructure is in place to support changing Gateway IPs.

type NativeLinkRoutes

type NativeLinkRoutes struct {
	Dependencies []pulumi.Resource
}

func (*NativeLinkRoutes) Install

func (component *NativeLinkRoutes) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install sets up the Routes for the NativeLink deployment.

Contrary to the rest of the NativeLink setup, these gateways aren't part of the regular deployment. Recreating the Gateways would change their local IPs which makes development less convenient. Instead, we create them once and take the IPs for granted to be fixed after initial creation.

It's unclear whether this indirection is the right approach and we might add them to the regular deployments when more infrastructure is in place to support changing Gateway IPs.

type RebuildNativeLink struct {
	Dependencies []pulumi.Resource
}

func (*RebuildNativeLink) Install

func (component *RebuildNativeLink) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs a Tekton Task, Pipeline and EventListener and some supporting resources which ultimately allow querying the cluster at a Gateway named `eventlistener` with requests like so:

``` EVENTLISTENER=$(kubectl get gtw eventlistener -o=jsonpath='{.status.addresses[0].value}')

# If imageNameOverride and imageTagOverride are unset, they default to: # $(nix eval <flakeOutput>.imageName --raw) # $(nix eval <flakeOutput>.imageTag --raw)

curl -v \
    -H 'content-Type: application/json' \
    -d '{
        "flakeOutput": "./src_root#image",
        "imageNameOverride": "nativelink",
        "imageTagOverride": "local"
    }' \
    http://${EVENTLISTENER}:8080

```

This pipeline only works with the specific local setup for the NativeLink development cluster. The Task makes use of the double-pipe through volumes `host -> kind -> K8s` to reuse the host's nix store and local nativelink git repository. It then pushes the container image to the container registry which previous infrastructure setups configured to pass through from host to the cluster. The result is that these Pipelines can complete in <15sec as opposed to ~10min without these optimizations.

WARNING: At the moment the Task makes use of `SYS_ADMIN` privilege escalation to interact with the host's nix socket and the kind node's container daemon.

type Registry

type Registry struct {
	InternalPort int
	ExternalPort int
}

A local container registry.

func (*Registry) Install

func (component *Registry) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs a local registry on the host and makes it available to a kind cluster.

type RouteConfig

type RouteConfig struct {
	Prefix        string
	Cluster       string
	PrefixRewrite string
	GRPC          bool
}

Route struct representing a route with prefix, cluster, and optional gRPC field.

type TektonDashboard

type TektonDashboard struct {
	Version      string
	Dependencies []pulumi.Resource
}

Configuration for the Tekton Dashboard.

func (*TektonDashboard) Install

func (component *TektonDashboard) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs the Tekton Dashboard on the cluster.

type TektonPipelines

type TektonPipelines struct {
	Version string
}

The configuration for Tekton Pipelines.

func (*TektonPipelines) Install

func (component *TektonPipelines) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs Tekton Pipelines on the cluster.

This function performs an additional feature-flag transformation to set `disable-affinity-assistant=true` and `coscheduling=pipelineruns`.

type TektonTriggers

type TektonTriggers struct {
	Version      string
	Dependencies []pulumi.Resource
}

The configuration for Tekton Triggers.

func (*TektonTriggers) Install

func (component *TektonTriggers) Install(
	ctx *pulumi.Context,
	name string,
) ([]pulumi.Resource, error)

Install installs the Tekton Triggers release and interceptors on the cluster.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL