Skip to content

Commit

Permalink
kbs: Simplify deployment overlays
Browse files Browse the repository at this point in the history
The current "s390x" overlay support is currently very SE specific,
whereas deploying on non-SE s390x with the sample KBS is still
an important scenario for our testing without specialised hardware.

This scenario deployment matches the x86_64 deployment scenario,
so let's go back to having a standard deployment, with a special
case for ibm-se rather to reduce duplication.

Co-authored-by: Hyounggyu Choi <[email protected]>
Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman and BbolroC committed Oct 3, 2024
1 parent 02c84c9 commit 171389d
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion kbs/config/kubernetes/custom_pccs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: coco-tenant

resources:
- ../nodeport/x86_64
- ../nodeport/

patches:
- path: set_custom_pccs.yaml
Expand Down
18 changes: 7 additions & 11 deletions kbs/config/kubernetes/deploy-kbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ set -euo pipefail
DEPLOYMENT_DIR="${DEPLOYMENT_DIR:-overlays}"

k8s_cnf_dir="$(dirname ${BASH_SOURCE[0]})"
ARCH=$(uname -m)

# Fail the script if the key.bin file does not exist.
key_file="${k8s_cnf_dir}/overlays/${ARCH}/key.bin"
key_file="${k8s_cnf_dir}/overlays/key.bin"
[[ -f "${key_file}" ]] || {
echo "key.bin not found at ${k8s_cnf_dir}/overlays/${ARCH}/"
echo "key.bin not found at ${k8s_cnf_dir}/overlays/"
exit 1
}

Expand All @@ -22,18 +21,15 @@ kbs_cert="${k8s_cnf_dir}/base/kbs.pem"
openssl pkey -in "${k8s_cnf_dir}/base/kbs.key" -pubout -out "${kbs_cert}"
}

if [ "${ARCH}" == "s390x" ]; then
if [ -n "${IBM_SE_CREDS_DIR:-}" ]; then
if [ "$(uname -m)" == "s390x" ] && [ -n "${IBM_SE_CREDS_DIR:-}" ]; then
# We are using the ibm-se overlay
DEPLOYMENT_DIR="${DEPLOYMENT_DIR}/ibm-se"
export NODE_NAME=$(kubectl get nodes -o jsonpath='{.items[0].metadata.name}')
envsubst <"${k8s_cnf_dir}/overlays/s390x/pv.yaml" | kubectl apply -f -
else
echo "IBM_SE_CREDS_DIR is empty" >&2
exit 1
fi
envsubst <"${k8s_cnf_dir}/${DEPLOYMENT_DIR}/pv.yaml" | kubectl apply -f -
fi

if [[ "${DEPLOYMENT_DIR}" == "nodeport" || "${DEPLOYMENT_DIR}" == "overlays" ]]; then
kubectl apply -k "${k8s_cnf_dir}/${DEPLOYMENT_DIR}/${ARCH}"
kubectl apply -k "${k8s_cnf_dir}/${DEPLOYMENT_DIR}"
else
kubectl apply -k "${k8s_cnf_dir}/${DEPLOYMENT_DIR}"
fi
2 changes: 1 addition & 1 deletion kbs/config/kubernetes/ita/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ images:
newTag: ita-as-v0.10.1

resources:
- ../nodeport/x86_64
- ../nodeport/

configMapGenerator:
- name: kbs-config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: coco-tenant

resources:
- ../../overlays/x86_64
- ../../overlays/ibm-se

patches:
- path: patch.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: coco-tenant

resources:
- ../../overlays/s390x
- ../overlays/

patches:
- path: patch.yaml
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions kbs/config/kubernetes/overlays/common/kustomization.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: coco-tenant

resources:
- ../common
- ../../base
- pvc.yaml

patches:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: coco-tenant

resources:
- ../common
- ../base

patches:
- path: patch.yaml
Expand Down
File renamed without changes.

0 comments on commit 171389d

Please sign in to comment.