Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use minimal cluster builder/stack/store for local dev scenario #3714

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading