forked from metal-stack/csi-driver-lvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: add build related works for webhook
Signed-off-by: Vicente Cheng <[email protected]>
- Loading branch information
1 parent
110abcd
commit 466ce08
Showing
11 changed files
with
253 additions
and
13 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
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
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,57 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "harvester-csi-driver-lvm-webhook.labels" . | nindent 4 }} | ||
{{- if .Values.webhook.replicas }} | ||
# The annotation does not support 0 replicas. | ||
annotations: | ||
management.cattle.io/scale-available: "{{ .Values.webhook.replicas }}" | ||
{{- end }} | ||
name: harvester-csi-driver-lvm-webhook | ||
spec: | ||
{{- if not .Values.webhook.replicas }} | ||
# Use this field instead of the scale-available annotation when it is 0 replicas. | ||
replicas: {{ .Values.webhook.replicas }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "harvester-csi-driver-lvm-webhook.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "harvester-csi-driver-lvm-webhook.labels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: harvester-csi-driver-lvm-webhook | ||
{{- if .Values.tolerations.webhook }} | ||
tolerations: | ||
{{ toYaml .Values.tolerations.webhook | indent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: harvester-csi-driver-lvm-webhook | ||
image: "{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }} | ||
env: | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
command: | ||
- csi-driver-lvm-webhook | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: harvester-csi-driver-lvm-webhook | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
{{- include "harvester-csi-driver-lvm-webhook.selectorLabels" . | nindent 4 }} | ||
ports: | ||
- name: https | ||
port: 443 | ||
protocol: TCP | ||
targetPort: {{ .Values.webhook.httpsPort }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# syntax=docker/dockerfile:1.7.0 | ||
|
||
FROM registry.suse.com/bci/bci-base:15.6 | ||
|
||
RUN zypper -n rm container-suseconnect && \ | ||
zypper -n install util-linux-systemd lvm2 e2fsprogs nvme-cli device-mapper xfsprogs && \ | ||
zypper -n clean -a && rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \ | ||
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \ | ||
exit 1; \ | ||
fi | ||
|
||
ENV ARCH=${TARGETPLATFORM#linux/} | ||
|
||
COPY bin/csi-driver-lvm-webhook-${ARCH} /usr/bin/csi-driver-lvm-webhook | ||
ENTRYPOINT ["csi-driver-lvm-webhook"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
set -e | ||
|
||
./package_lvmplugin | ||
./package_lvm_provisioner | ||
./package_lvm_provisioner | ||
./package_lvm_webhook |
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,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
source $(dirname $0)/version | ||
|
||
cd $(dirname $0)/.. | ||
|
||
IMAGE=${REPO}/harvester-lvm-csi-driver-webhook:${TAG} | ||
DOCKERFILE=package/Dockerfile.webhook | ||
if [ -e ${DOCKERFILE}.${ARCH} ]; then | ||
DOCKERFILE=${DOCKERFILE}.${ARCH} | ||
fi | ||
|
||
buildx build --load -f ${DOCKERFILE} -t ${IMAGE} . | ||
echo Built ${IMAGE} |