Skip to main content

Access Your Cluster with kubectl

You can connect to your GlueOps environment with kubectl using your GitHub identity — no certificates or passwords to manage. Sign-in happens through your browser, and access is scoped to your team's environment namespace at one of four permission tiers.

Prerequisites​

  • kubectl installed on your machine.
  • krew — the plugin manager for kubectl.
  • oidc-login — the kubectl credential plugin that handles the browser sign-in. Install it with krew (kubectl krew install oidc-login), and make sure ~/.krew/bin is on your PATH so kubectl can find it.
  • Membership in one of your organization's kubectl GitHub teams (see Access tiers below). Your Platform Administrator manages team membership.
  • Your kubeconfig, available from your cluster information page: https://cluster-info.nonprod.antoniostacos.onglueops.com
tip

If the domain above doesn't look right, update your Captain Domain in the top navigation bar.

1. Create your kubeconfig​

Open your cluster information page at https://cluster-info.nonprod.antoniostacos.onglueops.com and copy the kubeconfig shown there. It comes with the cluster's certificate authority and sign-in configuration already embedded — no editing required.

Paste it into kubectl's default config file:

mkdir -p ~/.kube
# paste the copied kubeconfig into this file with your editor:
nano ~/.kube/config

kubectl picks this file up automatically — no environment variables needed.

caution

If you already have a ~/.kube/config for other clusters, don't overwrite it — merge the new cluster, context, and user entries into your existing file instead.

2. Connect and sign in​

Run any command against your environment namespace — that's the first part of your Captain Domain, so for nonprod.antoniostacos.onglueops.com it is nonprod:

kubectl get pods -n nonprod

The first time, kubectl starts a device sign-in flow:

  1. Your terminal prints a verification URL and a one-time code (your browser may open automatically).
  2. In the browser, enter the code if prompted and sign in with GitHub.
  3. Back in your terminal, the command completes and prints your pods.
note

Your token is cached after sign-in, so the browser step only happens occasionally — not on every command.

To avoid typing -n <namespace> on every command, set it as your default once:

kubectl config set-context --current --namespace=nonprod

Access tiers​

Your permissions depend on which GitHub team you belong to. There are four tiers, each including everything from the tier above it:

TierGitHub teamWhat you can do
Readernonprod.antoniostacos.onglueops.com-kubectl-readerView pods, logs, services, deployments, ingresses, and ExternalSecrets status. No access to secret values.
Reader Plusnonprod.antoniostacos.onglueops.com-kubectl-reader-plusEverything in Reader, plus: port-forward to pods.
Debuggernonprod.antoniostacos.onglueops.com-kubectl-debuggerEverything in Reader Plus, plus: exec into pods, attach, restart deployments, and delete stuck pods.
Operatornonprod.antoniostacos.onglueops.com-kubectl-operatorEverything in Debugger, plus: delete any resource in your namespace.

To see which groups you signed in with, run kubectl auth whoami. To check whether your tier allows a specific action, run kubectl auth can-i <verb> <resource> -n <namespace>.

note

The platform is GitOps-managed: you can't create or apply resources with kubectl. Deleting a resource causes ArgoCD to recreate it from your deployment-configurations repository — that's the intended way to force a clean resync.

Your access is namespace-scoped​

Every tier grants access only within your environment namespace. Commands that list across the cluster will be denied:

caution

kubectl get namespaces, kubectl get pods -A, and node-level views return Forbidden. This is by design, not an error — always work within your namespace with -n <namespace> or a default namespace set.

Troubleshooting​

Error from server (Forbidden)​

In order of likelihood:

  1. Missing or wrong -n <namespace> — you only have access to your own environment namespace.
  2. The action needs a higher tier — check the Access tiers table and verify with kubectl auth can-i <verb> <resource> -n <namespace>.
  3. You're not in a kubectl GitHub team yet — contact your Platform Administrator.

Device code expired or browser window closed​

Just rerun your kubectl command — a fresh code is issued each time.

Signed in but permissions seem stale​

Tokens are cached locally. After your team membership changes, clear the cache and sign in again:

kubectl oidc-login clean

Connection times out before any sign-in prompt​

API access is restricted to an IP allowlist. If you're connecting from a new network or VPN and the connection hangs or is refused without ever showing a sign-in prompt, ask your Platform Administrator to add your IP address.

Next steps​