update osartifact chart

This commit is contained in:
Sebastian Florek 2025-01-23 14:02:15 +01:00
parent 3ff8acf5bb
commit 9ccb59d242
No known key found for this signature in database
GPG Key ID: DBC7C083B0200A0F
5 changed files with 55 additions and 28 deletions

View File

@ -1,7 +1,7 @@
name: Publish OS Builder Chart
on:
workflow_dispatch:
workflow_dispatch:
push:
paths:
- charts/osbuilder

View File

@ -5,4 +5,4 @@ maintainers:
- name: Plural
email: support@plural.sh
type: application
version: 0.3.0
version: 0.4.0

View File

@ -1,7 +1,8 @@
apiVersion: build.kairos.io/v1alpha2
kind: OSArtifact
metadata:
name: '{{ include "osartifact.fullname" . }}'
name: {{ include "osartifact.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
imageName: {{ .Values.image }}
iso: true
@ -19,24 +20,13 @@ spec:
{{ $key }}: {{ $value }}
{{- end }}
cloudConfigRef:
name: '{{ include "osartifact.fullname" . }}-cloud-config'
key: 'cloud-config.yaml'
exporters:
- template:
spec:
restartPolicy: Never
containers:
- name: upload
image: quay.io/curl/curl
command:
- /bin/sh
args:
- -c
- |
for f in $(ls /artifacts)
do
curl -T /artifacts/$f http://osartifactbuilder-operator-osbuilder-nginx/upload/$f
done
volumeMounts:
- name: artifacts
mountPath: /artifacts
name: {{ include "osartifact.fullname" . }}-config
key: cloud-config.yaml
outputImage:
registry: {{ .Values.exporter.registry }}
repository: {{ .Values.exporter.repository }}
tag: {{ .Values.exporter.tag }}
username: {{ .Values.exporter.username }}
passwordSecretKeyRef:
name: {{ .Values.exporter.configSecret.name | default (printf "%s-%s" (include "osartifact.fullname" .) "config") }}
key: {{ .Values.exporter.configSecret.key }}

View File

@ -5,11 +5,18 @@
{{ $token := index $tokenSecret.data .Values.tokenSecret.key | b64dec }}
{{ $password := index $passwordSecret.data .Values.passwordSecret.key | b64dec }}
{{ $dockerUserPassword := "" }}
{{- if .Values.exporter.passwordSecret.name }}
{{ $dockerUserPasswordSecret := (lookup "v1" "Secret" .Release.Namespace .Values.exporter.passwordSecret.name )}}
{{ $dockerUserPassword = index $passwordSecret.data .Values.exporter.passwordSecret.key | b64dec }}
{{- end }}
kind: Secret
apiVersion: v1
metadata:
name: '{{ include "osartifact.fullname" . }}-cloud-config'
name: {{ include "osartifact.fullname" . }}-config
namespace: {{ .Release.Namespace }}
stringData:
cloud-config.yaml: |
#cloud-config
@ -80,4 +87,14 @@ stringData:
{{ .Values.extraCloudConfig | toYaml | nindent 4 }}
{{- end }}
{{- if $dockerUserPassword }}
config.json: |
{
"auths": {
"{{ .Values.exporter.registry }}": {
"auth": {{ printf "%s:%s" .Values.exporter.username $dockerUserPassword | b64enc }}
}
}
}
{{- end }}
{{- end}}

View File

@ -24,10 +24,9 @@ project: default
# Console URL that will be used by the device to join the fleet, i.e. console.plrl-xyz.onplural.sh
url: ~
# Secret that holds bootstrap token used to register the cluster within Plural
tokenSecret:
# Name of the secret that holds the bootstrap token
name: ~
# Key in the secret that holds the bootstrap token
key: token
# A list of our required bundles that should be added to the result ISO image.
@ -62,4 +61,25 @@ extraUserCloudConfig: ~
# authorized_keys:
# kairos:
# - github:myusername
extraCloudConfig: ~
extraCloudConfig: ~
# Export configuration for the final ISO images
exporter:
# Docker registry DNS name where we should export packed ISO images
registry: ~
# Name of the repository where images should be stored
repository: plural-edge
# Image tag that should be used when pushing to the registry
tag: latest
# Repository username used for basic auth
username: ~
# Secret that stores just the password for the docker registry user.
# One of 'passwordSecret' or 'configSecret' must be provided.
passwordSecret:
name: ~
key: password
# Secret configuration that stores the docker config.json file with the auth information.
# It is in the default docker format.
configSecret:
name: ~
key: config.json