Fix: default image_repo for supervisor,concierge, packages installed in

global kapp-controller-packaging-global
This commit is contained in:
Benjamin A. Petersen 2023-08-29 12:41:35 -04:00
parent 7b858d62a3
commit 3e0bdf1638
No known key found for this signature in database
GPG Key ID: EF6EF83523A4BE46
5 changed files with 25 additions and 19 deletions

View File

@ -77,6 +77,7 @@ mkdir -p "./${PACKAGE_REPOSITORY_DIR}/packages/supervisor.pinniped.dev"
PACKAGE_INSTALL_DIR="temp_actual_deploy_resources"
rm -rf "./${PACKAGE_INSTALL_DIR}"
mkdir "./${PACKAGE_INSTALL_DIR}"
## TODO:
## "${resource_name}/deployment.yml" vs "${resource_name}/deployment-HACKED.yml"
@ -188,18 +189,19 @@ PINNIPED_PACKAGE_RBAC_FILE="./${PACKAGE_INSTALL_DIR}/${PINNIPED_PACKAGE_RBAC_PRE
echo -n "" > "${PINNIPED_PACKAGE_RBAC_FILE}"
cat <<EOF >> "${PINNIPED_PACKAGE_RBAC_FILE}"
---
apiVersion: v1
kind: Namespace
metadata:
name: "${NAMESPACE}"
# ---
# apiVersion: v1
# kind: Namespace
# metadata:
# name: "${NAMESPACE}" <--- "supervisor-ns" will cause other package install errors.
---
# ServiceAccount details from the file linked above
apiVersion: v1
kind: ServiceAccount
metadata:
name: "${PINNIPED_PACKAGE_RBAC_PREFIX}-sa-superadmin-dangerous"
namespace: "${NAMESPACE}"
# namespace: "${NAMESPACE}"
namespace: default # --> sticking to default for everything for now.
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
@ -217,7 +219,8 @@ metadata:
subjects:
- kind: ServiceAccount
name: "${PINNIPED_PACKAGE_RBAC_PREFIX}-sa-superadmin-dangerous"
namespace: "${NAMESPACE}"
# namespace: "${NAMESPACE}"
namespace: default # --> sticking to default for everything for now.
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
@ -228,7 +231,7 @@ EOF
kapp deploy --app "${PINNIPED_PACKAGE_RBAC_PREFIX}" --file "${PINNIPED_PACKAGE_RBAC_FILE}" -y
done
#FOOBAR="pinniped-package-rbac"
#PINNIPED_PACKAGE_RBAC_FILE="./${PACKAGE_INSTALL_DIR}/${PINNIPED_PACKAGE_RBAC_PREFIX}-rbac.yml"
## TODO: obviously a mega-role that can do everything is not good.
#echo -n "" > "${PINNIPED_PACKAGE_RBAC_FILE}"
@ -250,7 +253,8 @@ kind: PackageInstall
metadata:
# name, does not have to be versioned, versionSelection.constraints below will handle
name: "${resource_name}-package-install"
namespace: "${NAMESPACE}" # TODO: ---????? is this namespace ok?
# namespace: "${NAMESPACE}"
namespace: default # --> sticking to default for everything for now.
spec:
serviceAccountName: "${PINNIPED_PACKAGE_RBAC_PREFIX}-sa-superadmin-dangerous"
packageRef:

8
deploy_carvel/delete.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# unfortunately all by hand.
kubectl delete ns supervisor-ns
kubectl delete ns concierge-ns
kubectl delete packageinstall concierge-package-install
kubectl delete packageinstall supervisor-package-install

View File

@ -1,4 +0,0 @@
#!/bin/bash
# not a lot to this.
kapp delete --app pinn-super && kapp delete --app pinn-conci

View File

@ -2,7 +2,7 @@ apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
name: concierge.pinniped.dev.0.25.0
namespace: concierge-ns
namespace: kapp-controller-packaging-global
spec:
refName: concierge.pinniped.dev
version: 0.25.0

View File

@ -2,7 +2,7 @@ apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
name: supervisor.pinniped.dev.0.25.0
namespace: supervisor-ns
namespace: kapp-controller-packaging-global
spec:
refName: supervisor.pinniped.dev
version: 0.25.0
@ -39,9 +39,8 @@ spec:
default: 2
image_repo:
type: string
nullable: true
description: Specify either an image_digest or an image_tag. If both are given, only image_digest will be used.
default: null
default: projects.registry.vmware.com/pinniped/pinniped-server
image_digest:
type: string
nullable: true
@ -49,9 +48,8 @@ spec:
default: null
image_tag:
type: string
nullable: true
description: Specify either an image_digest or an image_tag. If both are given, only image_digest will be used.
default: null
default: latest
package_image_repo:
type: string
nullable: true