Skip to content

Kubernetes — kubectl

kubectl signs in with your Pub Invest account through the kubelogin plugin.

Install

brew install kubectl int128/kubelogin/kubelogin
winget install Kubernetes.kubectl
choco install kubelogin

Kubeconfig

TODO

Publish the kubeconfig (API server address, CA, OIDC issuer and client ID) here or link to it.

users:
  - name: pubinvest
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        command: kubectl
        args:
          - oidc-login
          - get-token
          - --oidc-issuer-url=<issuer>
          - --oidc-client-id=<client-id>

The first command opens a browser to sign in (it listens on localhost:8000, or 18000 if that's busy).

kubectl get pods -n <team-namespace>

Handy commands

kubectl logs -n <ns> deploy/<app> -f          # follow logs
kubectl rollout restart -n <ns> deploy/<app>  # restart (non-prod)
kubectl port-forward -n <ns> svc/<svc> 8080:80