devzone 1.1.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/Dockerfile +4 -4
- package/.devcontainer/{agent-erreurs.sh → agent-errors.sh} +6 -6
- package/.devcontainer/agent-local.sh +2 -2
- package/.devcontainer/{agent-modele.messages → agent-model.messages} +1 -1
- package/.devcontainer/{agent-modele.sh → agent-model.sh} +5 -5
- package/.devcontainer/agent-pod-manifest.sh +4 -4
- package/.devcontainer/{agent-droits.sh → agent-rights.sh} +2 -2
- package/.devcontainer/agent-session.sh +3 -3
- package/.devcontainer/{agent-etat-json.sh → agent-state-json.sh} +6 -6
- package/.devcontainer/agent-workspace.sh +1 -1
- package/.devcontainer/agent.sh +14 -14
- package/.devcontainer/{ia/docker-garde.sh → ai/docker-guard.sh} +1 -1
- package/.devcontainer/{ia → ai}/host-models.sh +2 -2
- package/.devcontainer/{ia/plugins/devzone-garde-v2.js → ai/plugins/devzone-guard-v2.js} +7 -7
- package/.devcontainer/{ia/plugins/devzone-garde.js → ai/plugins/devzone-guard.js} +6 -6
- package/.devcontainer/argocd/argocd.sh +94 -93
- package/.devcontainer/argocd/{catalogue-argocd.sh → catalog-argocd.sh} +3 -3
- package/.devcontainer/argocd/services-hook.sh +8 -8
- package/.devcontainer/argocd/services.sh +1 -1
- package/.devcontainer/catalog/app.sh +209 -0
- package/.devcontainer/catalog/catalog-watcher.sh +130 -0
- package/.devcontainer/{catalogue → catalog}/mysql/app.conf +1 -1
- package/.devcontainer/catalog/mysql/install.sh +87 -0
- package/.devcontainer/catalog/mysql/mysql.sh +262 -0
- package/.devcontainer/catalog/mysql/volume.sh +71 -0
- package/.devcontainer/catalog.sh +231 -0
- package/.devcontainer/chart-direct.sh +1 -1
- package/.devcontainer/cluster.sh +222 -224
- package/.devcontainer/clusters.sh +41 -41
- package/.devcontainer/devcontainer.json +1 -1
- package/.devcontainer/devzone +103 -1506
- 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/argocd.sh +2 -2
- package/.devcontainer/gitlab/chart.sh +2 -2
- package/.devcontainer/gitlab/gitlab.sh +83 -84
- package/.devcontainer/gitlab/installation.sh +111 -111
- 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 +65 -0
- package/.devcontainer/kind-wrapper.sh +45 -0
- package/.devcontainer/kube-account.sh +199 -0
- package/.devcontainer/kube-config.sh +45 -46
- package/.devcontainer/{invite-kube.sh → kube-prompt.sh} +6 -6
- package/.devcontainer/kube-reachable.sh +64 -0
- package/.devcontainer/{memoire.sh → memory.sh} +1 -1
- package/.devcontainer/metrics-server.sh +2 -2
- package/.devcontainer/opencode.jsonc +2 -2
- package/.devcontainer/packages.sh +228 -0
- package/.devcontainer/password.sh +1 -1
- package/.devcontainer/ports-auto.sh +152 -153
- package/.devcontainer/ports-json.sh +16 -15
- package/.devcontainer/ports.sh +127 -123
- package/.devcontainer/post-create.sh +52 -52
- package/.devcontainer/postgres/postgres.sh +176 -176
- package/.devcontainer/rename-legacy-files.sh +103 -0
- package/.devcontainer/services-admin.sh +5 -5
- package/.devcontainer/skills/devzone/SKILL.md +40 -41
- package/.devcontainer/startup.sh +65 -0
- package/.devcontainer/{etat-gitops.sh → state-gitops.sh} +1 -1
- package/.devcontainer/{etat-json.sh → state-json.sh} +39 -65
- package/.devcontainer/{etat-verrou.sh → state-lock.sh} +1 -1
- package/.devcontainer/{etat.sh → state.sh} +4 -4
- package/.devcontainer/workspace-init.sh +17 -3
- package/Makefile +8 -8
- package/README.md +195 -194
- package/charts/devzone-workspace/templates/statefulset.yaml +1 -1
- package/manage/devzone +8 -10
- package/manage/scripts/argocd-workspace.sh +1 -1
- package/manage/scripts/check-go-layout.sh +40 -0
- package/manage/scripts/check-names.sh +61 -0
- package/manage/scripts/create-cluster.sh +1 -1
- package/manage/scripts/create-mode.sh +2 -2
- package/manage/scripts/devzone-create.sh +5 -5
- package/manage/scripts/devzone-manifest.sh +3 -3
- package/manage/scripts/devzone-update.sh +12 -8
- package/manage/scripts/docker-workstation.sh +2 -2
- package/manage/scripts/docker.sh +2 -2
- package/manage/scripts/{lancer.sh → launch.sh} +10 -51
- package/manage/scripts/{migrer-retour.sh → migrate-revert.sh} +4 -4
- package/manage/scripts/{migrer.sh → migrate.sh} +8 -14
- package/manage/scripts/ports-apps.sh +1 -1
- package/manage/scripts/ports-workspace.sh +7 -7
- package/manage/scripts/{desinstaller.sh → 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/manage/workspace.sh +4 -4
- package/package.json +1 -1
- package/.devcontainer/catalogue/app.sh +0 -211
- package/.devcontainer/catalogue/catalogue-veilleur.sh +0 -130
- package/.devcontainer/catalogue/mysql/installer.sh +0 -87
- package/.devcontainer/catalogue/mysql/mysql.sh +0 -262
- package/.devcontainer/catalogue/mysql/volume.sh +0 -71
- package/.devcontainer/catalogue.sh +0 -231
- package/.devcontainer/demarrage.sh +0 -66
- package/.devcontainer/docker-relais.sh +0 -149
- package/.devcontainer/docker-sans-hote.sh +0 -12
- package/.devcontainer/git-identite.sh +0 -28
- package/.devcontainer/isolement.sh +0 -65
- package/.devcontainer/kind-enveloppe.sh +0 -45
- package/.devcontainer/kube-compte.sh +0 -200
- package/.devcontainer/kube-joignable.sh +0 -64
- package/.devcontainer/paquets.sh +0 -227
- /package/.devcontainer/{ia/docker-garde.message → ai/docker-guard.message} +0 -0
- /package/.devcontainer/{ia → ai}/host-check.message +0 -0
- /package/.devcontainer/{ia → ai}/host-check.sh +0 -0
|
@@ -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
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
|
63
63
|
// Identité git, clusters, puis récapitulatif de ce qui reste à faire
|
|
64
|
-
"postStartCommand": "bash .devcontainer/
|
|
64
|
+
"postStartCommand": "bash .devcontainer/startup.sh",
|
|
65
65
|
// Clusters kind du conteneur (config) + cluster de l'hôte (hote.config,
|
|
66
66
|
// refait à chaque démarrage par kube-config.sh)
|
|
67
67
|
"remoteEnv": {
|