Helm2airgap
Jump to navigation
Jump to search
yum install skopeo -y
podman login --authfile $(realpath ~/${REGISTRY_FQDN_DST}-auth.json ) ${REGISTRY_FQDN_DST}
helm dependency build
helm template . --set certmanager-issuer.email=example@domain.org >k8s.yaml
cat k8s.yaml |grep -v ${REGISTRY_FQDN_DST} |sed -rn 's!^[[:space:]]*[^#].*\bimage:[[:space:]]*([[:graph:]]+)!\1!p' |sed -r 's#@.*##' |tr -d '"' |tr -d "'" |\
while read b ;do
IMAGE_PATH=$b
skopeo copy docker://$b docker://${REGISTRY_FQDN_DST}'/'${PROJECT_ORGANISATION}'/'${PROJECT_NAME}'/'${IMAGE_PATH} &&(
sed -ri 's#^(.*[[:space:]]image:).*'${IMAGE_PATH}'.*$#\1 '${REGISTRY_FQDN_DST}'/'${PROJECT_ORGANISATION}'/'${PROJECT_NAME}'/'${IMAGE_PATH}'#g' k8s.yaml )
done
kubectl apply -f k8s.yaml