Skip to content

Commit

Permalink
just: enable deploying custom resources
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Jan 7, 2025
1 parent d4892d3 commit d1d868e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ kube.conf
out.env
infra/**/kustomization.yaml
uplosi.conf*
.custom/
17 changes: 10 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,19 @@ populate target=default_deploy_target platform=default_platform:
set -euo pipefail
mkdir -p ./{{ workspace_dir }}
mkdir -p ./{{ workspace_dir }}/deployment
target="{{ target }}"
if [[ "${target}" == "custom" ]]; then
target=""
cp -r ./.custom/* ./{{ workspace_dir }}/deployment/
fi
nix shell .#contrast --command resourcegen \
--image-replacements ./{{ workspace_dir }}/just.containerlookup \
--namespace {{ target }}${namespace_suffix-} \
--add-port-forwarders \
--add-logging \
--add-dmesg \
--platform {{ platform }} \
{{ target }} coordinator > ./{{ workspace_dir }}/deployment/deployment.yml
${target} coordinator > ./{{ workspace_dir }}/deployment/deployment.yml
echo "{{ target }}${namespace_suffix-}" > ./{{ workspace_dir }}/just.namespace
# Generate policies, update manifest.
Expand Down Expand Up @@ -136,16 +141,11 @@ apply target=default_deploy_target:
case {{ target }} in
"runtime")
kubectl apply -f ./{{ workspace_dir }}/runtime
exit 0
;;
"openssl" | "emojivoto" | "volume-stateful-set" | "mysql")
:
;;
*)
kubectl apply -f ./{{ workspace_dir }}/deployment/ns.yml
kubectl apply -f ./{{ workspace_dir }}/deployment
;;
esac
kubectl apply -f ./{{ workspace_dir }}/deployment
# Delete Kubernetes manifests.
undeploy:
Expand Down Expand Up @@ -306,6 +306,9 @@ wait-for-workload target=default_deploy_target:
nix run .#scripts.kubectl-wait-ready -- $ns mysql-backend
nix run .#scripts.kubectl-wait-ready -- $ns mysql-client
;;
"custom")
:
;;
*)
echo "Please register workloads of new targets in wait-for-workload"
exit 1
Expand Down

0 comments on commit d1d868e

Please sign in to comment.