-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1634 from aleskandro/multiarch-native-builds
Native multi-arch ClusterBuildStrategy
- Loading branch information
Showing
11 changed files
with
659 additions
and
60 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
545 changes: 545 additions & 0 deletions
545
...ta1/buildstrategy/multiarch-native-buildah/buildstrategy_multiarch_native_buildah_cr.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
samples/v1beta1/buildstrategy/multiarch-native-buildah/role_multiarch_native_buildah_cr.yaml
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,28 @@ | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: multiarch-native-buildah-pipeline | ||
rules: | ||
- verbs: | ||
- get | ||
- list | ||
- watch | ||
resources: | ||
- pods | ||
apiGroups: | ||
- "" | ||
- verbs: | ||
- create | ||
resources: | ||
- pods/exec | ||
apiGroups: | ||
- "" | ||
- verbs: | ||
- get | ||
- list | ||
- create | ||
- watch | ||
resources: | ||
- jobs | ||
apiGroups: | ||
- batch |
11 changes: 11 additions & 0 deletions
11
...beta1/buildstrategy/multiarch-native-buildah/rolebinding_multiarch_native_buildah_cr.yaml
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,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: multiarch-native-buildah-pipeline | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: multiarch-native-buildah-pipeline | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pipeline |
14 changes: 14 additions & 0 deletions
14
...ildstrategy/multiarch-native-buildah/rolebinding_multiarch_native_buildah_scc_okd_cr.yaml
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,14 @@ | ||
# NOTE: This is needed secifically in OKD/OpenShift environments. | ||
# The pipeline service account should be allowed running pods that require | ||
# the privileged SecurityContextConstraint. | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: multiarch-native-buildah-pipeline-scc-privileged | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pipeline | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: 'system:openshift:scc:privileged' |
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,32 @@ | ||
--- | ||
apiVersion: shipwright.io/v1beta1 | ||
kind: Build | ||
metadata: | ||
name: multiarch-native-buildah-ex | ||
spec: | ||
source: | ||
type: Git | ||
git: | ||
url: https://github.com/shipwright-io/sample-go | ||
contextDir: docker-build | ||
strategy: | ||
name: multiarch-native-buildah | ||
kind: ClusterBuildStrategy | ||
paramValues: | ||
- name: architectures | ||
values: | ||
# Setting only to amd64 for the tests to run on amd64 only clusters | ||
- value: "amd64" | ||
- name: build-contexts | ||
values: | ||
- value: "ghcr.io/shipwright-io/shipwright-samples/golang:1.18=docker://ghcr.io/shipwright-io/shipwright-samples/golang:1.18" | ||
# The buildah `--from` replaces the first FROM statement | ||
- name: from | ||
value: "" # Using the build-contexts for this example | ||
# The runtime-stage-from implements the logic to replace the last stage FROM image of a Dockerfile | ||
- name: runtime-stage-from | ||
value: docker://gcr.io/distroless/static:nonroot | ||
- name: dockerfile | ||
value: Dockerfile | ||
output: | ||
image: image-registry.openshift-image-registry.svc:5000/build-examples/taxi-app |
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,8 @@ | ||
--- | ||
apiVersion: shipwright.io/v1beta1 | ||
kind: BuildRun | ||
metadata: | ||
name: multiarch-native-buildah-ex | ||
spec: | ||
build: | ||
name: multiarch-native-buildah-ex |
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
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