Permission: READ by default
Default is inspect-only. Do not mutate cluster / ArgoCD / DB unless the user explicitly asks for that action in the current turn.
Default allowed: kubectl get/describe/logs/top/auth can-i, read secrets for diagnosis, Application get/history/diff via kubectl, psql SELECT / \d / \dt / \di with LIMIT, aws sts / eks update-kubeconfig / sso login for local auth, optional port-forward to view Argo UI/API, OpenSearch Discover read/search via browser session (shared SIT recipe).
Mutating (only if user explicitly asks): kubectl apply|create|delete|patch|replace|rollout|scale|exec, argocd app sync|rollback|delete|prune, Secret/ConfigMap edits, SQL write/DDL, pod restarts. If not explicitly requested — refuse and stay read-only.
When to Use
Use when the user asks to inspect Auxiliary SIT / aux-eks live state: pod logs, OpenSearch historical logs, restarts, ArgoCD app sync/health/history, deployment image/tag, ExternalSecret status, or Postgres connection settings for an Aux service (sms, email, portal, ekyc, special-list, los-credit-card, consent, datamart). Triggers: ดู log aux sit, aux-neo, aux-eks, argocd-auxiliary, หา postgres บน aux, debug auxiliary, opensearch aux, search log sit. Not for Core cluster — use neo-core-sit. Not for mutating cluster state unless the user explicitly asks.
Local auth (required env)
No AWS profile name is baked into this skill. Before any aws / eks call:
- Read env
NEO_AUX_AWS_PROFILE.
- If unset/empty → stop. Tell the user to export it to their local profile name, e.g.
export NEO_AUX_AWS_PROFILE=<profile-in-aws-config>
Optional helper: copy sit.env.example → keep outside git / shell rc.
Do not invent a default profile name.
- Resolve region from that profile:
REGION=$(aws configure get region --profile "$NEO_AUX_AWS_PROFILE")
If empty → stop and ask user to set region on that profile in ~/.aws/config.
- Optional:
aws configure get sso_role_name --profile "$NEO_AUX_AWS_PROFILE" — expect org role AuxiliaryEsignatureAccess.
Use "$NEO_AUX_AWS_PROFILE" and "$REGION" in every aws command below. Shorthand: $PROFILE / $REGION.
Procedure
- Identity map (org SIT — shared team defaults):
- Env: Auxiliary SIT
- AWS account (expect): 290768402609 — confirm live via sts
- EKS cluster:
aux-eks-goqmac0w
- Preferred kubectl context alias:
aux-neo (full ARN context may also exist)
- Argo Application namespace:
argocd-app (majority); rare apps may sit in argocd
- Workloads: multi-namespace by domain
- Argo flavor: self-hosted in-cluster (
argocd-server present). UI: https://argocd-auxiliary.sit.awesome-poc-th.com
- Typical RDS cluster id fragment:
rds-aux-goqmac0w; typical db name: sit_auxiliary
- Connect / heal access (every session):
- Require
$PROFILE / $REGION per Local auth above.
aws sts get-caller-identity --profile "$PROFILE". Expect account 290768402609 and role AuxiliaryEsignatureAccess. On Forbidden or expired session: aws sso login --profile "$PROFILE" (user approves browser).
- If context missing or API unreachable:
aws eks update-kubeconfig --name aux-eks-goqmac0w --region "$REGION" --profile "$PROFILE" --alias aux-neo
- Smoke:
kubectl --context aux-neo get ns AND kubectl --context aux-neo get applications -n argocd-app.
Always pass --context aux-neo.
- Namespace map (resolve live first via Application destination):
- consent / tc-service → consent
- datamart-* → datamart
- e-document → e-signature
- ekyc-* → ekyc
- email-* → email
- los-credit-card family → los-credit-card
- as-app / as-service / example-* → ndid-interface
- push-notification → notification
- portal-* → portal
- sms → sms
- special-list-* → special-list
- kafbat-ui → kafbat-ui
- kong → kong
- common-service → auxiliary-systems
Fuzzy search:
kubectl --context aux-neo get deploy,secrets -A then use the grep tool on the output for FRAGMENT (do not … | rg in bash).
- Inspect logs / health (read-only):
Choose path:
| Need |
Path |
| Last ~15–30m, pod still running |
A. kubectl |
Older window / pod rotated / count by msg / multi-pod history |
B. OpenSearch |
A. kubectl (recent)
- List pods in NS, then
kubectl --context aux-neo logs -n NS deploy/DEPLOY --since=15m --tail=500
- Also useful:
--tail=200, --previous on crash
- Recent events in NS; optional top pods
- Running image via deploy jsonpath
containers[0].image
- Deploy names can differ from Argo app names — list deploy -n NS first.
- Filter: use the grep tool on command output/temp file. Never
kubectl … | rg or … | grep in bash.
B. OpenSearch (historical) — shared SIT store; do not fork the recipe:
Read skill://neo-core-sit/references/opensearch-sit.md (canonical measured recipe).
Same host/index as Core: opensearch.sit.awesome-poc-th.com / console-sit-log.
Filter kubernetes_container_name to the Aux container/deploy name (not Core’s payment unless that is the target).
Sync XHR in browser only; SSO cold-start → ask user to log in; no cookie→curl path unless newly proven.
Aux containers are expected on the same index; if zero hits, confirm container name via a live pod before concluding “no logs”.
ArgoCD status:
Path A (preferred for agents): kubectl Application CRDs in ns argocd-app. Columns name, destination.namespace, sync, health, revision. One-app jq for sync/rev/health/dest/images/conditions. History via status.history last entries.
Path B (optional CLI/UI): UI at argocd-auxiliary.sit.awesome-poc-th.com with SSO. argocd-server is ClusterIP — port-forward svc/argocd-server -n argocd if CLI needed. Local admin account disabled.
Default read-only. No sync/prune/delete unless user explicitly requests mutate.
Postgres settings from K8s secrets (principle: fuzzy-find secret by service name, then read connection fields):
kubectl get secrets -n NS then grep tool for FRAGMENT. Names may end with -secret or -secrets.
- Three common layouts (helper handles all): yaml blob (config.yaml/secrets.yaml), discrete POSTGRES_*, discrete DB_*.
- Reuse helper (do NOT rewrite ad-hoc Python each time): resolve relative to this skill dir (parent of
SKILL.md):
scripts/pg-from-secret# SKILL_DIR = directory containing this SKILL.md
PG="$SKILL_DIR/scripts/pg-from-secret"
# Aux needs explicit ns + secret (multi-namespace)
"$PG" --context aux-neo --namespace sms --secret sms-service-secret
"$PG" --context aux-neo --namespace portal --secret portal-backend-secrets --psql -- \
-c 'SELECT current_user, current_database();'
eval "$("$PG" --context aux-neo --namespace sms --secret sms-service-secret --export)"
- Manual fallback only if the helper fails.
- In chat report host/database/user/schema by default; auth field only when user asked to connect.
- SELECT/describe + LIMIT only; never write/DDL.
- ExternalSecret drift: get externalsecret -A filtered by FRAGMENT; inspect clustersecretstore/secretstore.
- Report in Thai, terminal-friendly: identity (account/role from sts; profile from env only); Argo sync/health + image; pod ready/restarts; log snippets with timestamps (and OpenSearch msg counts when used); DB host/db/user/schema by default. Never write decoded credentials into repo files, skill bodies, or durable memory.
Pitfalls
- Core SIT is a different AWS account/cluster — use
neo-core-sit + NEO_CORE_AWS_PROFILE.
- Missing
NEO_AUX_AWS_PROFILE → fail fast; never guess a profile name.
- Argo apps mainly in argocd-app; argocd namespace is the control plane.
- Wrong namespace is the top miss — resolve Application destination first.
- Secret name suffix is inconsistent (-secret vs -secrets).
- Three credential layouts (yaml blob / POSTGRES_* / DB_*) — do not assume Core-style config.yaml only.
- argocd-server is ClusterIP; CLI needs port-forward or use UI SSO. Local admin disabled.
- Private RDS — extracted settings do not imply laptop connectivity.
- Read-only by default: no apply/delete/sync/edits unless user asks.
- Never persist decoded credentials into git, skills, or memory.
- OpenSearch: shared recipe under
neo-core-sit; do not pipe kubectl to rg; sync XHR only; ask user on SSO cold start.
Verification
NEO_AUX_AWS_PROFILE set; aws configure get region --profile "$PROFILE" non-empty.
- sts get-caller-identity with that profile shows account 290768402609 and AuxiliaryEsignatureAccess.
- kubectl --context aux-neo get ns lists argocd, argocd-app, and domain namespaces.
- kubectl --context aux-neo get applications -n argocd-app lists Aux apps.
- For a named service: destination NS resolved, deploy/logs readable, matching secret yields one of the three Postgres layouts.
- When using OpenSearch: follow
skill://neo-core-sit/references/opensearch-sit.md; XHR 200; counts sum to total when aggregating.
1---2name: neo-aux-sit3description: Connect to Auxiliary SIT (kubectl + self-hosted ArgoCD) to inspect logs (kubectl + OpenSearch), deploy status, and locate Postgres connection settings inside service K8s secrets for debugging.4---5## Permission: READ by default67Default is **inspect-only**. Do not mutate cluster / ArgoCD / DB unless the user **explicitly** asks for that action in the current turn.89**Default allowed:** `kubectl get/describe/logs/top/auth can-i`, read secrets for diagnosis, Application get/history/diff via kubectl, `psql` SELECT / \\d / \\dt / \\di with LIMIT, `aws sts` / `eks update-kubeconfig` / `sso login` for local auth, optional port-forward to view Argo UI/API, OpenSearch Discover **read/search** via browser session (shared SIT recipe).1011**Mutating (only if user explicitly asks):** `kubectl apply|create|delete|patch|replace|rollout|scale|exec`, `argocd app sync|rollback|delete|prune`, Secret/ConfigMap edits, SQL write/DDL, pod restarts. If not explicitly requested — refuse and stay read-only.1213## When to Use14Use when the user asks to inspect Auxiliary SIT / aux-eks live state: pod logs, OpenSearch historical logs, restarts, ArgoCD app sync/health/history, deployment image/tag, ExternalSecret status, or Postgres connection settings for an Aux service (sms, email, portal, ekyc, special-list, los-credit-card, consent, datamart). Triggers: ดู log aux sit, aux-neo, aux-eks, argocd-auxiliary, หา postgres บน aux, debug auxiliary, opensearch aux, search log sit. Not for Core cluster — use `neo-core-sit`. Not for mutating cluster state unless the user explicitly asks.1516## Local auth (required env)1718**No AWS profile name is baked into this skill.** Before any `aws` / `eks` call:19201. Read env `NEO_AUX_AWS_PROFILE`.212. If unset/empty → **stop**. Tell the user to export it to their local profile name, e.g. 22 `export NEO_AUX_AWS_PROFILE=<profile-in-aws-config>` 23 Optional helper: copy `sit.env.example` → keep outside git / shell rc. 24 Do **not** invent a default profile name.253. Resolve region from that profile: 26 `REGION=$(aws configure get region --profile "$NEO_AUX_AWS_PROFILE")` 27 If empty → stop and ask user to set `region` on that profile in `~/.aws/config`.284. Optional: `aws configure get sso_role_name --profile "$NEO_AUX_AWS_PROFILE"` — expect org role **AuxiliaryEsignatureAccess**.2930Use `"$NEO_AUX_AWS_PROFILE"` and `"$REGION"` in every aws command below. Shorthand: `$PROFILE` / `$REGION`.3132## Procedure331. Identity map (org SIT — shared team defaults):34- Env: Auxiliary SIT35- AWS account (expect): 290768402609 — confirm live via sts36- EKS cluster: `aux-eks-goqmac0w`37- Preferred kubectl context alias: `aux-neo` (full ARN context may also exist)38- Argo Application namespace: `argocd-app` (majority); rare apps may sit in `argocd`39- Workloads: multi-namespace by domain40- Argo flavor: self-hosted in-cluster (`argocd-server` present). UI: `https://argocd-auxiliary.sit.awesome-poc-th.com`41- Typical RDS cluster id fragment: `rds-aux-goqmac0w`; typical db name: `sit_auxiliary`422. Connect / heal access (every session):431) Require `$PROFILE` / `$REGION` per **Local auth** above.442) `aws sts get-caller-identity --profile "$PROFILE"`. Expect account **290768402609** and role **AuxiliaryEsignatureAccess**. On Forbidden or expired session: `aws sso login --profile "$PROFILE"` (user approves browser).453) If context missing or API unreachable: 46 `aws eks update-kubeconfig --name aux-eks-goqmac0w --region "$REGION" --profile "$PROFILE" --alias aux-neo`474) Smoke: `kubectl --context aux-neo get ns` AND `kubectl --context aux-neo get applications -n argocd-app`. 48Always pass `--context aux-neo`.493. Namespace map (resolve live first via Application destination):50- consent / tc-service → consent51- datamart-* → datamart52- e-document → e-signature53- ekyc-* → ekyc54- email-* → email55- los-credit-card family → los-credit-card56- as-app / as-service / example-* → ndid-interface57- push-notification → notification58- portal-* → portal59- sms → sms60- special-list-* → special-list61- kafbat-ui → kafbat-ui62- kong → kong63- common-service → auxiliary-systems64Fuzzy search: `kubectl --context aux-neo get deploy,secrets -A` then use the **grep tool** on the output for FRAGMENT (do not `… | rg` in bash).654. Inspect logs / health (read-only):6667**Choose path:**68| Need | Path |69|---|---|70| Last ~15–30m, pod still running | **A. kubectl** |71| Older window / pod rotated / count by `msg` / multi-pod history | **B. OpenSearch** |7273**A. kubectl (recent)**74- List pods in NS, then `kubectl --context aux-neo logs -n NS deploy/DEPLOY --since=15m --tail=500`75- Also useful: `--tail=200`, `--previous` on crash76- Recent events in NS; optional top pods77- Running image via deploy jsonpath `containers[0].image`78- Deploy names can differ from Argo app names — list deploy -n NS first.79- **Filter:** use the **grep tool** on command output/temp file. **Never** `kubectl … | rg` or `… | grep` in bash.8081**B. OpenSearch (historical)** — shared SIT store; **do not fork the recipe**:821. Read `skill://neo-core-sit/references/opensearch-sit.md` (canonical measured recipe).832. Same host/index as Core: `opensearch.sit.awesome-poc-th.com` / `console-sit-log`.843. Filter `kubernetes_container_name` to the **Aux** container/deploy name (not Core’s `payment` unless that is the target).854. Sync XHR in browser only; SSO cold-start → ask user to log in; no cookie→curl path unless newly proven.865. Aux containers are expected on the same index; if zero hits, confirm container name via a live pod before concluding “no logs”.87885. ArgoCD status:89Path A (preferred for agents): kubectl Application CRDs in ns argocd-app. Columns name, destination.namespace, sync, health, revision. One-app jq for sync/rev/health/dest/images/conditions. History via status.history last entries.90Path B (optional CLI/UI): UI at argocd-auxiliary.sit.awesome-poc-th.com with SSO. argocd-server is ClusterIP — port-forward svc/argocd-server -n argocd if CLI needed. Local admin account disabled.91Default read-only. No sync/prune/delete unless user explicitly requests mutate.926. Postgres settings from K8s secrets (principle: fuzzy-find secret by service name, then read connection fields):931) `kubectl get secrets -n NS` then grep tool for FRAGMENT. Names may end with -secret or -secrets.942) Three common layouts (helper handles all): yaml blob (config.yaml/secrets.yaml), discrete POSTGRES_*, discrete DB_*.953) **Reuse helper (do NOT rewrite ad-hoc Python each time):** resolve relative to this skill dir (parent of `SKILL.md`):96 `scripts/pg-from-secret`97 ```bash98 # SKILL_DIR = directory containing this SKILL.md99 PG="$SKILL_DIR/scripts/pg-from-secret"100 # Aux needs explicit ns + secret (multi-namespace)101 "$PG" --context aux-neo --namespace sms --secret sms-service-secret102 "$PG" --context aux-neo --namespace portal --secret portal-backend-secrets --psql -- \103 -c 'SELECT current_user, current_database();'104 eval "$("$PG" --context aux-neo --namespace sms --secret sms-service-secret --export)"105 ```1064) Manual fallback only if the helper fails.1075) In chat report host/database/user/schema by default; auth field only when user asked to connect.1086) SELECT/describe + LIMIT only; never write/DDL.1097. ExternalSecret drift: get externalsecret -A filtered by FRAGMENT; inspect clustersecretstore/secretstore.1108. Report in Thai, terminal-friendly: identity (account/role from sts; profile from env only); Argo sync/health + image; pod ready/restarts; log snippets with timestamps (and OpenSearch msg counts when used); DB host/db/user/schema by default. Never write decoded credentials into repo files, skill bodies, or durable memory.111112## Pitfalls113- Core SIT is a different AWS account/cluster — use `neo-core-sit` + `NEO_CORE_AWS_PROFILE`.114- Missing `NEO_AUX_AWS_PROFILE` → fail fast; never guess a profile name.115- Argo apps mainly in argocd-app; argocd namespace is the control plane.116- Wrong namespace is the top miss — resolve Application destination first.117- Secret name suffix is inconsistent (-secret vs -secrets).118- Three credential layouts (yaml blob / POSTGRES_* / DB_*) — do not assume Core-style config.yaml only.119- argocd-server is ClusterIP; CLI needs port-forward or use UI SSO. Local admin disabled.120- Private RDS — extracted settings do not imply laptop connectivity.121- Read-only by default: no apply/delete/sync/edits unless user asks.122- Never persist decoded credentials into git, skills, or memory.123- OpenSearch: shared recipe under `neo-core-sit`; do not pipe kubectl to `rg`; sync XHR only; ask user on SSO cold start.124125## Verification1261. `NEO_AUX_AWS_PROFILE` set; `aws configure get region --profile "$PROFILE"` non-empty.1272. sts get-caller-identity with that profile shows account 290768402609 and AuxiliaryEsignatureAccess.1283. kubectl --context aux-neo get ns lists argocd, argocd-app, and domain namespaces.1294. kubectl --context aux-neo get applications -n argocd-app lists Aux apps.1305. For a named service: destination NS resolved, deploy/logs readable, matching secret yields one of the three Postgres layouts.1316. When using OpenSearch: follow `skill://neo-core-sit/references/opensearch-sit.md`; XHR 200; counts sum to total when aggregating.