kubectl gitlab-ui plugin
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
- Status: Experiment
The kubectl gitlab-ui plugin runs the GitLab Operator UI and its API on your own machine. The
plugin acts as your kubeconfig identity, the same way kubectl does. Client certificate, exec, OIDC, and token
credentials all work. You do not create a service account or paste a token.
Use the plugin to:
- Open the Operator UI.
- Migrate a
GitLabresource to aGitLabCore. - Migrate a Helm release of the GitLab chart to a
GitLabCore.
The plugin writes the custom resources only. To deploy the instances you configure, an Operator with the Operator UI reconcilers enabled must run in the cluster. For more information, see Try the Operator UI in a development environment.
Install the plugin
No release ships a binary of the plugin. Build it from the source of the GitLab Operator.
Prerequisites:
- Git, and
kubectl. - Go, Node.js with npm, and Task. The project pins their versions in
mise.toml.
To install the plugin:
Clone the GitLab Operator project:
git clone https://gitlab.com/gitlab-org/cloud-native/gitlab-operator.git cd gitlab-operatorCheck out the branch of the Operator image you run. For the
latest-operator-uiimage, stay on the default branch.Optional. If you use mise, install the pinned tool versions:
mise installBuild and install the plugin:
task install-kubectl-pluginThe task builds the UI, then installs the
kubectl-gitlab_uibinary withgo install. The binary goes to$GOBINwhen it is set, and to$(go env GOPATH)/binotherwise. The task prints the path.Add that directory to your
PATH, becausekubectlfinds plugins on thePATH. For example, add this line to your shell profile:export PATH="$(go env GOPATH)/bin:$PATH"Verify that
kubectlfinds the plugin:kubectl plugin list | grep kubectl-gitlab_ui
To update the plugin, pull the branch and run task install-kubectl-plugin again.
Start the Operator UI
Prerequisites:
- Your kubeconfig identity has the verbs you need on
gitlabcores.apps.gitlab.com,siphons.apps.gitlab.com, andorbits.apps.gitlab.com. To create, edit, and delete instances, grantget,list,watch,create,update,patch, anddelete. - Optional. To choose a namespace from a list in the form, your identity has
liston namespaces. To create a namespace from the form, it also hascreateon namespaces.
To start the Operator UI:
Run the plugin against your current kubeconfig context:
kubectl gitlab-uiThe plugin prints the identity it acts as and the URL, and opens the URL in your browser. The header of the UI shows Local kubeconfig identity. For the API documentation, open
/docson the same URL.When you are done, stop the plugin with Control+C.
The plugin listens on 127.0.0.1:8090. When that port is busy, the plugin picks a free port and
prints it.
To use another context on another port, without opening a browser:
kubectl gitlab-ui --context <your_context> --port 9000 --no-openFor all options, run kubectl gitlab-ui --help.
Reach the plugin from another host
The plugin does not authenticate requests. Anyone who reaches the port acts with the permissions of your kubeconfig. Bind an address other than loopback only on a network you trust.
To run the plugin in a container or on a remote host, bind a routable address with --address.
The plugin prints a warning when the address is not loopback.
The plugin answers 403 to an API request addressed to a host name it does not expect. It accepts
loopback names, such as localhost, and the bind address. To reach the plugin under another name,
such as a DNS entry or a container host name, pass the name to --accept-hosts:
kubectl gitlab-ui --address 0.0.0.0 --accept-hosts operator-ui.example.com --no-openThe plugin also answers 403 to an API request that the browser marks as sent from another site.
Clients that are not browsers, such as curl, are not affected.