devzone 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/agent-errors.sh +6 -6
- package/.devcontainer/agent-pod-manifest.sh +4 -4
- package/.devcontainer/agent-session.sh +2 -2
- package/.devcontainer/agent-state-json.sh +2 -2
- package/.devcontainer/agent-workspace.sh +1 -1
- package/.devcontainer/agent.sh +7 -7
- package/.devcontainer/ai/host-models.sh +2 -2
- package/.devcontainer/ai/plugins/devzone-guard-v2.js +3 -3
- package/.devcontainer/ai/plugins/devzone-guard.js +3 -3
- package/.devcontainer/argocd/argocd.sh +90 -89
- package/.devcontainer/argocd/catalog-argocd.sh +2 -2
- package/.devcontainer/argocd/services-hook.sh +3 -3
- package/.devcontainer/argocd/services.sh +1 -1
- package/.devcontainer/catalog/app.sh +114 -116
- package/.devcontainer/catalog/catalog-watcher.sh +62 -62
- package/.devcontainer/catalog/mysql/app.conf +1 -1
- package/.devcontainer/catalog/mysql/install.sh +40 -40
- package/.devcontainer/catalog/mysql/mysql.sh +141 -141
- package/.devcontainer/catalog/mysql/volume.sh +39 -39
- package/.devcontainer/catalog.sh +112 -112
- package/.devcontainer/chart-direct.sh +1 -1
- package/.devcontainer/cluster.sh +216 -218
- package/.devcontainer/clusters.sh +41 -41
- package/.devcontainer/devzone +92 -1495
- package/.devcontainer/devzone-ai-guard.sh +76 -0
- package/.devcontainer/devzone-ai.sh +201 -0
- package/.devcontainer/devzone-cluster.sh +210 -0
- package/.devcontainer/devzone-modules.sh +126 -0
- package/.devcontainer/devzone-platform.sh +189 -0
- package/.devcontainer/devzone-repair.sh +94 -0
- package/.devcontainer/devzone-services.sh +241 -0
- package/.devcontainer/devzone-skill.sh +97 -0
- package/.devcontainer/devzone-status.sh +140 -0
- package/.devcontainer/devzone-version.sh +78 -0
- package/.devcontainer/git-identity.sh +28 -0
- package/.devcontainer/gitlab/chart.sh +2 -2
- package/.devcontainer/gitlab/gitlab.sh +81 -82
- package/.devcontainer/gitlab/installation.sh +109 -109
- package/.devcontainer/gitlab/secrets.sh +47 -47
- package/.devcontainer/gitlab/seed.sh +77 -77
- package/.devcontainer/gitlab/test-gitlab.sh +242 -243
- package/.devcontainer/help.sh +1 -1
- package/.devcontainer/isolation.sh +30 -30
- package/.devcontainer/kind-wrapper.sh +17 -17
- package/.devcontainer/kube-account.sh +112 -113
- package/.devcontainer/kube-config.sh +45 -46
- package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
- package/.devcontainer/kube-reachable.sh +40 -40
- package/.devcontainer/memory.sh +1 -1
- package/.devcontainer/metrics-server.sh +2 -2
- package/.devcontainer/opencode.jsonc +2 -2
- package/.devcontainer/packages.sh +136 -135
- package/.devcontainer/password.sh +1 -1
- package/.devcontainer/ports-auto.sh +152 -153
- package/.devcontainer/ports-json.sh +16 -15
- package/.devcontainer/ports.sh +126 -122
- package/.devcontainer/post-create.sh +52 -52
- package/.devcontainer/postgres/postgres.sh +174 -174
- package/.devcontainer/rename-legacy-files.sh +103 -0
- package/.devcontainer/services-admin.sh +3 -3
- package/.devcontainer/skills/devzone/SKILL.md +40 -41
- package/.devcontainer/startup.sh +48 -49
- package/.devcontainer/state-gitops.sh +1 -1
- package/.devcontainer/state-json.sh +36 -62
- package/.devcontainer/state.sh +2 -2
- package/.devcontainer/workspace-init.sh +16 -2
- package/Makefile +1 -1
- package/README.md +195 -194
- package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
- package/manage/devzone +5 -7
- package/manage/scripts/argocd-workspace.sh +1 -1
- package/manage/scripts/check-names.sh +6 -5
- package/manage/scripts/create-cluster.sh +1 -1
- package/manage/scripts/create-mode.sh +2 -2
- package/manage/scripts/devzone-create.sh +3 -3
- package/manage/scripts/devzone-manifest.sh +1 -1
- package/manage/scripts/devzone-update.sh +12 -8
- package/manage/scripts/launch.sh +7 -48
- package/manage/scripts/migrate-revert.sh +3 -3
- package/manage/scripts/migrate.sh +7 -13
- package/manage/scripts/ports-apps.sh +1 -1
- package/manage/scripts/ports-workspace.sh +7 -7
- package/manage/scripts/uninstall.sh +8 -8
- package/manage/scripts/workspace-egress.sh +2 -2
- package/manage/scripts/workspace-update.sh +5 -2
- package/manage/scripts/workspace-wait.sh +2 -2
- package/package.json +1 -1
- package/.devcontainer/docker-relay.sh +0 -149
- package/.devcontainer/docker-without-host.sh +0 -12
- package/.devcontainer/git-identite.sh +0 -28
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# View of the connected clusters (#337): visible contexts, type, state, namespace.
|
|
3
3
|
ICI="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
-
if ! declare -F
|
|
4
|
+
if ! declare -F cluster_is_local >/dev/null 2>&1; then
|
|
5
5
|
# shellcheck source=SCRIPTDIR/cluster.sh
|
|
6
6
|
# shellcheck disable=SC1091
|
|
7
7
|
. "$ICI/cluster.sh"
|
|
8
8
|
fi
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
local
|
|
13
|
-
|
|
14
|
-
ctx_services="$(
|
|
10
|
+
# Shows the view of the connected clusters.
|
|
11
|
+
clusters_show() {
|
|
12
|
+
local contexts=() ctx ctx_work ctx_services tmp i ns type state mark marks
|
|
13
|
+
ctx_work="$(kubectl config current-context 2>/dev/null || true)"
|
|
14
|
+
ctx_services="$(cluster_saved 2>/dev/null || true)"
|
|
15
15
|
while IFS= read -r ctx; do
|
|
16
16
|
[ -n "$ctx" ] || continue
|
|
17
|
-
|
|
17
|
+
contexts+=("$ctx")
|
|
18
18
|
done < <(kubectl config get-contexts -o name 2>/dev/null || true)
|
|
19
19
|
|
|
20
|
-
if [ "${#
|
|
21
|
-
echo "
|
|
20
|
+
if [ "${#contexts[@]}" -eq 0 ]; then
|
|
21
|
+
echo "no cluster: kind create cluster, or devzone enable kubernetes"
|
|
22
22
|
return 0
|
|
23
23
|
fi
|
|
24
24
|
|
|
25
|
-
printf '%s %-14s %-8s %-12s %s\n' " " "
|
|
25
|
+
printf '%s %-14s %-8s %-12s %s\n' " " "CONTEXT" "TYPE" "STATE" "NAMESPACE"
|
|
26
26
|
tmp="$(mktemp -d)"
|
|
27
|
-
for i in "${!
|
|
28
|
-
ctx="${
|
|
27
|
+
for i in "${!contexts[@]}"; do
|
|
28
|
+
ctx="${contexts[$i]}"
|
|
29
29
|
(
|
|
30
30
|
if kubectl --context "$ctx" --request-timeout=3s get --raw /readyz >/dev/null 2>&1; then
|
|
31
|
-
echo
|
|
31
|
+
echo reachable
|
|
32
32
|
else
|
|
33
|
-
echo
|
|
33
|
+
echo unreachable
|
|
34
34
|
fi
|
|
35
35
|
) >"$tmp/$i" &
|
|
36
36
|
done
|
|
37
37
|
wait
|
|
38
|
-
for i in "${!
|
|
39
|
-
ctx="${
|
|
40
|
-
|
|
41
|
-
if
|
|
38
|
+
for i in "${!contexts[@]}"; do
|
|
39
|
+
ctx="${contexts[$i]}"
|
|
40
|
+
state="$(cat "$tmp/$i" 2>/dev/null || echo unreachable)"
|
|
41
|
+
if cluster_is_local "$ctx" >/dev/null 2>&1; then
|
|
42
42
|
type=local
|
|
43
43
|
else
|
|
44
|
-
type=
|
|
44
|
+
type=remote
|
|
45
45
|
fi
|
|
46
46
|
ns="$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"$ctx\")].context.namespace}" 2>/dev/null || true)"
|
|
47
47
|
[ -n "$ns" ] || ns=default
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if [ "$ctx" = "$
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
mark=""
|
|
49
|
+
marks=0
|
|
50
|
+
if [ "$ctx" = "$ctx_work" ]; then
|
|
51
|
+
mark+="★"
|
|
52
|
+
marks=$((marks + 1))
|
|
53
53
|
fi
|
|
54
54
|
if [ "$ctx" = "$ctx_services" ]; then
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
mark+="●"
|
|
56
|
+
marks=$((marks + 1))
|
|
57
57
|
fi
|
|
58
|
-
while [ "$
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
while [ "$marks" -lt 2 ]; do
|
|
59
|
+
mark+=" "
|
|
60
|
+
marks=$((marks + 1))
|
|
61
61
|
done
|
|
62
|
-
printf '%s %-14s %-8s %-12s %s\n' "$
|
|
62
|
+
printf '%s %-14s %-8s %-12s %s\n' "$mark" "$ctx" "$type" "$state" "$ns"
|
|
63
63
|
done
|
|
64
64
|
rm -rf "$tmp"
|
|
65
65
|
echo
|
|
66
|
-
echo "★ cluster
|
|
67
|
-
#
|
|
68
|
-
if [ -n "$ctx_services" ] &&
|
|
66
|
+
echo "★ working cluster (kubectl, k9s, helm) · ● devzone services cluster (devzone cluster)"
|
|
67
|
+
# Display of the NetworkPolicy isolation state for the services cluster
|
|
68
|
+
if [ -n "$ctx_services" ] && cluster_is_local "$ctx_services"; then
|
|
69
69
|
if kubectl --context "$ctx_services" get networkpolicy devzone-meme-namespace -n devzone-postgres >/dev/null 2>&1; then
|
|
70
|
-
printf ' ✔
|
|
70
|
+
printf ' ✔ isolated (NetworkPolicy) → %s\n' "$ctx_services"
|
|
71
71
|
else
|
|
72
|
-
printf ' ⚠
|
|
72
|
+
printf ' ⚠ isolated (NetworkPolicy missing) → %s\n' "$ctx_services"
|
|
73
73
|
fi
|
|
74
74
|
printf ' devzone → %s\n' "$ctx_services"
|
|
75
75
|
fi
|
|
76
76
|
return 0
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
#
|
|
80
|
-
clusters() {
|
|
81
|
-
# Alias
|
|
82
|
-
devzone_clusters() {
|
|
79
|
+
# Aliases of the devzone clusters command.
|
|
80
|
+
clusters() { clusters_show "$@"; }
|
|
81
|
+
# Alias for the tests and direct calls.
|
|
82
|
+
devzone_clusters() { clusters_show "$@"; }
|
|
83
83
|
|
|
84
84
|
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
|
85
|
-
|
|
85
|
+
clusters_show "$@"
|
|
86
86
|
fi
|