From dce39b5a711b31ac075df6580ad520324d008c0e Mon Sep 17 00:00:00 2001 From: Eguo Wang Date: Mon, 2 Jan 2023 02:58:54 +0800 Subject: [PATCH] Added cluster builder, store and stack for kpack --- charts/amphitheatre/Chart.yaml | 2 +- .../templates/cluster-builder.yaml | 19 +++++++++++++++++++ .../amphitheatre/templates/cluster-stack.yaml | 10 ++++++++++ .../amphitheatre/templates/cluster-store.yaml | 8 ++++++++ charts/amphitheatre/templates/secret.yaml | 10 ++++++++++ .../templates/serviceaccount.yaml | 14 +++++--------- 6 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 charts/amphitheatre/templates/cluster-builder.yaml create mode 100644 charts/amphitheatre/templates/cluster-stack.yaml create mode 100644 charts/amphitheatre/templates/cluster-store.yaml create mode 100644 charts/amphitheatre/templates/secret.yaml diff --git a/charts/amphitheatre/Chart.yaml b/charts/amphitheatre/Chart.yaml index 9acb3fc..700c0e7 100644 --- a/charts/amphitheatre/Chart.yaml +++ b/charts/amphitheatre/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.1 +version: 0.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/amphitheatre/templates/cluster-builder.yaml b/charts/amphitheatre/templates/cluster-builder.yaml new file mode 100644 index 0000000..89845b8 --- /dev/null +++ b/charts/amphitheatre/templates/cluster-builder.yaml @@ -0,0 +1,19 @@ +apiVersion: kpack.io/v1alpha2 +kind: ClusterBuilder +metadata: + name: amp-default-builder +spec: + tag: core.harbor.domain/library/amp-default-builder + stack: + name: base + kind: ClusterStack + store: + name: default + kind: ClusterStore + serviceAccountRef: + name: kpack-service-account + order: + - group: + - id: paketo-buildpacks/java + - group: + - id: paketo-buildpacks/nodejs diff --git a/charts/amphitheatre/templates/cluster-stack.yaml b/charts/amphitheatre/templates/cluster-stack.yaml new file mode 100644 index 0000000..346d569 --- /dev/null +++ b/charts/amphitheatre/templates/cluster-stack.yaml @@ -0,0 +1,10 @@ +apiVersion: kpack.io/v1alpha2 +kind: ClusterStack +metadata: + name: base +spec: + id: "io.buildpacks.stacks.bionic" + buildImage: + image: "paketobuildpacks/build:base-cnb" + runImage: + image: "paketobuildpacks/run:base-cnb" diff --git a/charts/amphitheatre/templates/cluster-store.yaml b/charts/amphitheatre/templates/cluster-store.yaml new file mode 100644 index 0000000..b96efe7 --- /dev/null +++ b/charts/amphitheatre/templates/cluster-store.yaml @@ -0,0 +1,8 @@ +apiVersion: kpack.io/v1alpha2 +kind: ClusterStore +metadata: + name: default +spec: + sources: + - image: gcr.io/paketo-buildpacks/java + - image: gcr.io/paketo-buildpacks/nodejs diff --git a/charts/amphitheatre/templates/secret.yaml b/charts/amphitheatre/templates/secret.yaml new file mode 100644 index 0000000..f6e1d3d --- /dev/null +++ b/charts/amphitheatre/templates/secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: harbor-registry-credentials + annotations: + kpack.io/docker: https://core.harbor.domain/ +type: kubernetes.io/basic-auth +stringData: + username: admin + password: Harbor12345 diff --git a/charts/amphitheatre/templates/serviceaccount.yaml b/charts/amphitheatre/templates/serviceaccount.yaml index f2dd1bf..56998f2 100644 --- a/charts/amphitheatre/templates/serviceaccount.yaml +++ b/charts/amphitheatre/templates/serviceaccount.yaml @@ -1,12 +1,8 @@ -{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "amphitheatre.serviceAccountName" . }} - labels: - {{- include "amphitheatre.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} + name: kpack-service-account +secrets: +- name: harbor-registry-credentials +imagePullSecrets: +- name: harbor-registry-credentials