Building container images on your cluster with Knative Build
Talk from KubeCon US 2018 in Seattle all about using Knative Build to run your build process on your Kubernetes cluster. Explains the usecase, the state of the project and speculates about the future.
can still run on Kubernetes - Not everything needs to be in the core API - Adoption of extensions will help Kubernetes stand the test of time Solving specific problems as well as general ones
created clusterrole.rbac.authorization.k8s.io "knative-build-admin" created serviceaccount "build-controller" created clusterrolebinding.rbac.authorization.k8s.io "build-controller-admin" created customresourcedefinition.apiextensions.k8s.io "builds.build.knative.dev" created customresourcedefinition.apiextensions.k8s.io "buildtemplates.build.knative.dev" created customresourcedefinition.apiextensions.k8s.io "clusterbuildtemplates.build.knative.dev" created customresourcedefinition.apiextensions.k8s.io "images.caching.internal.knative.dev" created service "build-controller" created service "build-webhook" created configmap "config-logging" created deployment.apps "build-controller" created deployment.apps "build-webhook" created
multiple steps where each step specifies a Builder. - A Builder is a type of container image that you create to accomplish any task, whether that's a single step in a process, or the whole process itself. - A BuildTemplate can be used to defined reusable templates. - Authenticate with ServiceAccount using Kubernetes Secrets. What are the new API primitives?
created $ kubectl get build NAME AGE date 9s $ kubectl get pods NAME READY STATUS RESTARTS AGE date-pod-c9b010 0/1 Init:1/2 0 41s $ kubectl logs date-pod-c9b010 Build successful
- name: IMAGE description: The name of the image to push - name: DOCKERFILE description: Path to the Dockerfile to build. default: /workspace/Dockerfile steps: - name: build-and-push image: gcr.io/kaniko-project/executor args: - --dockerfile=${DOCKERFILE} - --destination=${IMAGE}
- name: IMAGE description: The name of the image to push - name: DOCKERFILE description: Path to the Dockerfile to build. default: /workspace/Dockerfile steps: - name: build-and-push image: gcr.io/kaniko-project/executor args: - --dockerfile=${DOCKERFILE} - --destination=${IMAGE}
created $ kubectl get build kubeval-build -o yaml -w # grab the pod identifier $ kubectl logs -f kubeval-build-pod-8fd6e4 -c build-step-build-and-push INFO[0000] Downloading base image golang:1.8-alpine 2018/12/09 16:50:14 No matching credentials were found, falling back on anonymous INFO[0002] Executing 0 build triggers INFO[0002] Unpacking rootfs as cmd RUN apk --no-cache add make git requires it. INFO[0137] Taking snapshot of full filesystem... INFO[0138] Skipping paths under /builder/home, as it is a whitelisted directory INFO[0138] Skipping paths under /dev, as it is a whitelisted directory INFO[0138] Skipping paths under /kaniko, as it is a whitelisted directory INFO[0138] Skipping paths under /proc, as it is a whitelisted directory INFO[0138] Skipping paths under /sys, as it is a whitelisted directory INFO[0138] Skipping paths under /var/run, as it is a whitelisted directory
Parameters (2) Description Default ---------------- -------------------------------- --------------------- IMAGE The name of the image to push DOCKERFILE Path to the Dockerfile to build. /workspace/Dockerfile Steps (1) Image Command Args -------------- ------------------------------ --------- -------------------------- build-and-push gcr.io/kaniko-project/executor --dockerfile=${DOCKERFILE} --destination=${IMAGE}
--black FROM test-base AS Check RUN safety check FROM app AS Security ARG MICROSCANNER RUN wget -O /microscanner https://get.aquasec.com/microscanner && chmod +x /microscanner RUN /microscanner $MICROSCANNER --full-output FROM release CMD ["gunicorn", "-b", ":5000", "app:app"]
different CI systems on Kubernetes? - Custom scheduling algorithms for build? - Decouple description from consumption of build information? - Convertors for popular formats? - Opinionated per-language/framework builders, including full pipelines? Commence speculation
you’re building CI and building tooling then you should join the conversation - Knative Build needs folks experimenting with UI Low level bits are important, but not as important as end user solutions - Custom Resources in Kubernetes are great Expect further commoditization of parts of the software delivery toolchain If all you remember is...