- ✓ AIP1 Isambard-AI Phase 1 supported
- ✗ AIP2 Isambard-AI Phase 2 unsupported
- ✗ I3 Isambard 3 unsupported
- ✗ BC5 BlueCrystal 5 unsupported
Kubernetes: kubectl Access - Experimental Access Only
Warning
This guide describes the experimental Kubernetes service on Isambard-AI Phase 1, which is invite-only and not designed for production workloads. See the Kubernetes overview for details of the service, the cluster and the policies that apply to it.
You can use kubectl on your own machine to manage resources in your project's namespace on Isambard-AI Phase 1.
You log in with OIDC through Keycloak, which grants you the same permissions as your project service account (see Namespaces and service accounts).
kubectl is run from your own machine, not from the Isambard login nodes.
Install kubectl and kubelogin¶
-
Install
kubectlby following the Kubernetes install instructions for your operating system. -
Install kubelogin, which
kubectluses to log you in through Keycloak. kubelogin is akubectlplugin, and is run askubectl oidc-login. For example, with Krew or Homebrew:See the kubelogin setup instructions for other installation methods.
Not Azure kubelogin
Make sure you install
int128/kubelogin. Azure provides a different tool, also calledkubelogin, which will not work with Isambard-AI. -
Check the plugin is installed:
Create a kubeconfig file¶
Save the following to ~/.kube/isambard-ai.yaml, replacing <PROJECT> with your project's short code:
apiVersion: v1
kind: Config
clusters:
- name: isambard-ai
cluster:
server: https://apps.isambard.ac.uk/kubectl-k8s-on-compute
contexts:
- name: isambard-ai
context:
cluster: isambard-ai
user: isambard-ai-oidc
namespace: <PROJECT>
current-context: isambard-ai
users:
- name: isambard-ai-oidc
user:
exec:
apiVersion: client.authentication.k8s.io/v1
command: kubectl
args:
- oidc-login
- get-token
- --oidc-issuer-url=https://keycloak.isambard.ac.uk/realms/isambard
- --oidc-client-id=kubectl-k8s-on-compute
- --grant-type=device-code
interactiveMode: IfAvailable
Setting namespace in the context means you don't need to pass --namespace to every kubectl command.
Point kubectl at this file:
Add this line to your shell profile (for example ~/.bashrc or ~/.zshrc) to make it permanent.
If you already use other clusters, you can instead merge this file into your existing ~/.kube/config and switch between them with kubectl config use-context.
Log in¶
Run any kubectl command, for example:
The first time you run a command, kubelogin prints a URL and a code.
Open the URL in your browser, enter the code and log in through Keycloak with your Identity Provider.
kubectl then runs the command.
As you have not created anything yet, you should see:
To check who you are logged in as:
Your projectuser:<PROJECT>:<USERNAME> group is what gives you access to your project's namespace.
You can only see and manage resources in the <PROJECT> namespace.
kubelogin caches your token and logs you in again when it expires. To log out, delete the cache:
To see what you are allowed to do in your namespace:
Next steps¶
- Serve an LLM with KServe using
kubectl. - Make your model reachable from outside Isambard-AI through the Kubernetes Gateway Service.