Skip to content

Commit

Permalink
Use minimal cluster builder/stack/store for local dev scenario
Browse files Browse the repository at this point in the history
Co-authored-by: Georgi Sabev <[email protected]>
Co-authored-by: Danail Branekov <[email protected]>
  • Loading branch information
georgethebeatle and danail-branekov committed Jan 15, 2025
1 parent 69b756d commit 106ebc5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
3 changes: 0 additions & 3 deletions README.helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ Here are all the values that can be set for the chart:
- `builderReadinessTimeout` (_String_): The time that the kpack Builder will be waited for if not in ready state, berfore the build workload fails. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format, an additional `d` suffix for days is supported.
- `builderRepository` (_String_): Container image repository to store the `ClusterBuilder` image. Required when `clusterBuilderName` is not provided.
- `clusterBuilderName` (_String_): The name of the `ClusterBuilder` Kpack has been configured with. Leave blank to let `kpack-image-builder` create an example `ClusterBuilder`.
- `clusterStackBuildImage` (_String_): The image to use for building defined in the `ClusterStack`. Used when `clusterBuilderName` is blank.
- `clusterStackID` (_String_): The ID of the `ClusterStack`. Used when `clusterBuilderName` is blank.
- `clusterStackRunImage` (_String_): The image to use for running defined in the `ClusterStack`. Used when `clusterBuilderName` is blank.
- `include` (_Boolean_): Deploy the `kpack-image-builder` component.
- `replicas` (_Integer_): Number of replicas.
- `resources`: [`ResourceRequirements`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#resourcerequirements-v1-core) for the API.
Expand Down
44 changes: 44 additions & 0 deletions scripts/assets/templates/kind-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This is a template file! Do not apply directly!
# It can be instantiated with values from the environment
# using the envsubst command
---
apiVersion: kpack.io/v1alpha2
kind: ClusterStore
metadata:
name: kind-store
spec:
sources:
- image: gcr.io/paketo-buildpacks/procfile
- image: gcr.io/paketo-buildpacks/go
---
apiVersion: kpack.io/v1alpha2
kind: ClusterStack
metadata:
name: kind-stack
spec:
id: "io.buildpacks.stacks.jammy"
buildImage:
image: paketobuildpacks/build-jammy-base
runImage:
image: paketobuildpacks/run-jammy-base
---
apiVersion: kpack.io/v1alpha2
kind: ClusterBuilder
metadata:
name: kind-builder
spec:
serviceAccountRef:
name: kpack-service-account
namespace: cf
stack:
name: kind-stack
kind: ClusterStack
store:
name: kind-store
kind: ClusterStore
tag: "$BUILDER_TAG"
order:
- group:
- id: paketo-buildpacks/procfile
- group:
- id: paketo-buildpacks/go
13 changes: 10 additions & 3 deletions scripts/deploy-on-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ function deploy_korifi() {
--set=controllers.taskTTL="5s" \
--set=jobTaskRunner.jobTTL="5s" \
--set=containerRepositoryPrefix="$REPOSITORY_PREFIX" \
--set=kpackImageBuilder.clusterStackBuildImage="paketobuildpacks/build-jammy-base" \
--set=kpackImageBuilder.clusterStackRunImage="paketobuildpacks/run-jammy-base" \
--set=kpackImageBuilder.builderRepository="$KPACK_BUILDER_REPOSITORY" \
--set=kpackImageBuilder.clusterBuilderName="kind-builder" \
--set=networking.gatewayClass="contour" \
--set=networking.gatewayPorts.http="32080" \
--set=networking.gatewayPorts.https="32443" \
Expand Down Expand Up @@ -249,6 +247,14 @@ function create_registry_secret() {
--docker-password="$DOCKER_PASSWORD"
}

function create_cluster_builder() {
(
export BUILDER_TAG="$KPACK_BUILDER_REPOSITORY"
envsubst <"$SCRIPT_DIR/assets/templates/kind-builder.yml" | kubectl apply -f -
)
kubectl wait --for=condition=ready clusterbuilder --all=true --timeout=15m
}

function main() {
make -C "$ROOT_DIR" bin/yq

Expand All @@ -260,6 +266,7 @@ function main() {
create_namespaces
create_registry_secret
deploy_korifi
create_cluster_builder
configure_contour
}

Expand Down
2 changes: 0 additions & 2 deletions scripts/installer/install-korifi-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ spec:
--set=controllers.taskTTL="5s" \
--set=jobTaskRunner.jobTTL="5s" \
--set=containerRepositoryPrefix="localregistry-docker-registry.default.svc.cluster.local:30050/" \
--set=kpackImageBuilder.clusterStackBuildImage="paketobuildpacks/build-jammy-base" \
--set=kpackImageBuilder.clusterStackRunImage="paketobuildpacks/run-jammy-base" \
--set=kpackImageBuilder.builderRepository="localregistry-docker-registry.default.svc.cluster.local:30050/kpack-builder" \
--set=networking.gatewayClass="contour" \
--set=networking.gatewayPorts.http="32080" \
Expand Down

0 comments on commit 106ebc5

Please sign in to comment.