Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions setup/nuvolaris/system-api/opsfile.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,35 +36,35 @@ env:
SYS_API_CDB_HOST: couchdb

SYS_API_CDB_USER:
sh: $OPS debug kube ctl CMD="-n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}'"
sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.user}'

SYS_API_CDB_PASSWORD:
sh: $OPS debug kube ctl CMD="-n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}'"
sh: kubectl -n nuvolaris get wsk/controller -o jsonpath='{.spec.couchdb.admin.password}'

SYS_API_HOSTNAME:
sh: $OPS debug kube ctl CMD="-n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}'"
sh: kubectl -n nuvolaris get ingress/apihost -o jsonpath='{.spec.rules[0].host}'

INGRESS_TYPE:
sh: $OPS util ingress-type
sh: ops util ingress-type

REGISTRY_PASS:
sh: $OPS debug kube ctl CMD="-n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}'"
sh: kubectl -n nuvolaris get cm/config -o jsonpath='{.metadata.annotations.registry_password}'

tasks:
install-toml:
desc: Update the buildkitd.toml file config map
silent: true
cmds:
- task: remove-toml
- $OPS debug kube ctl CMD="-n nuvolaris create configmap nuvolaris-buildkitd-conf --from-file=$OPS_PWD/setup/nuvolaris/system-api/deploy/buildkit/buildkitd.toml"
- kubectl -n nuvolaris create configmap nuvolaris-buildkitd-conf --from-file="$OPS_ROOT/setup/nuvolaris/system-api/deploy/buildkit/buildkitd.toml"

remove-toml:
desc: Remove the buildkitd.toml config map
silent: true
cmds:
- |
if $OPS debug kube ctl CMD="-n nuvolaris get cm nuvolaris-buildkitd-conf" >/dev/null 2>&1;
then $OPS debug kube ctl CMD="-n nuvolaris delete configmap nuvolaris-buildkitd-conf"
if kubectl -n nuvolaris get cm nuvolaris-buildkitd-conf >/dev/null 2>&1;
then kubectl -n nuvolaris delete configmap nuvolaris-buildkitd-conf
fi

install-secret:
Expand All@@ -73,17 +73,17 @@ tasks:
cmds:
- task: remove-secret
- |
if ! $OPS debug kube ctl CMD="-n nuvolaris get secret registry-pull-secret-int" >/dev/null 2>&1;
then $OPS debug kube ctl CMD="create secret docker-registry registry-pull-secret-int --docker-server=http://nuvolaris-registry-svc:5000 --docker-username=opsuser --docker-password=${REGISTRY_PASS}"
if ! kubectl -n nuvolaris get secret registry-pull-secret-int >/dev/null 2>&1;
then kubectl create secret docker-registry registry-pull-secret-int --docker-server=http://nuvolaris-registry-svc:5000 --docker-username=opsuser --docker-password=${REGISTRY_PASS}
fi

remove-secret:
desc: Delete secret to push to internal registry
silent: true
cmds:
- |
if $OPS debug kube ctl CMD="-n nuvolaris get secret registry-pull-secret-int" >/dev/null 2>&1;
then $OPS debug kube ctl CMD="-n nuvolaris delete secret registry-pull-secret-int"
if kubectl -n nuvolaris get secret registry-pull-secret-int >/dev/null 2>&1;
then kubectl -n nuvolaris delete secret registry-pull-secret-int
fi


Expand All@@ -96,9 +96,9 @@ tasks:
- test -n "$IMAGES_SYSTEMAPI" || die "IMAGES_SYSTEMAPI is not set. Please set it to the desired image version."
- envsubst -i api-template.yaml -o _api.yaml > /dev/null 2>&1
- envsubst -i ${INGRESS_TYPE}-template.yaml -o _ingress.yaml > /dev/null 2>&1
- $OPS debug kube ctl CMD="-n nuvolaris apply -f $OPS_ROOT/setup/nuvolaris/system-api/_api.yaml"
- kubectl -n nuvolaris apply -f "$OPS_ROOT/setup/nuvolaris/system-api/_api.yaml"
#- cat _ingress.yaml
- $OPS debug kube ctl CMD="-n nuvolaris apply -f $OPS_ROOT/setup/nuvolaris/system-api/_ingress.yaml"
- kubectl -n nuvolaris apply -f "$OPS_ROOT/setup/nuvolaris/system-api/_ingress.yaml"
- task: install-toml
- task: install-secret
- |
Expand All@@ -111,7 +111,7 @@ tasks:
cmds:
- task: remove-secret
- task: remove-toml
- $OPS debug kube ctl CMD="-n nuvolaris delete sts/nuvolaris-system-api ing/nuvolaris-system-api-ingress svc/nuvolaris-system-api"
- kubectl -n nuvolaris delete sts/nuvolaris-system-api ing/nuvolaris-system-api-ingress svc/nuvolaris-system-api
- |
echo "System Admin API undeployed"

Expand All@@ -121,11 +121,11 @@ tasks:
desc: update the OpenServerless System Admin Api Stateful Set
cmds:
- task: deploy
- $OPS debug kube ctl CMD="-n nuvolaris rollout restart statefulset nuvolaris-system-api"
- kubectl -n nuvolaris rollout restart statefulset nuvolaris-system-api
preconditions:
- sh: '[ $IMAGES_SYSTEMAPI != $CURRENT_API_VERSION ]'
msg: "Current OpenServerless System API stateful set it is already updated to newest version. Request ignored."
env:
CURRENT_API_VERSION:
sh: |
echo $($OPS debug kube ctl CMD="-n nuvolaris get sts/nuvolaris-system-api -ojsonpath='{.spec.template.spec.containers[0].image}'")
echo $(kubectl -n nuvolaris get sts/nuvolaris-system-api -ojsonpath='{.spec.template.spec.containers[0].image}')