diff --git a/README.md b/README.md index e10b951e..28a1959e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # VM Console Proxy -It provides an endpoint to generate time limited tokens that are then used to access VNC. +This project adds a new API extension to Kubernetes, +that can be used to generate time limited tokens to access VNC. **Note:** This project no longer provides VNC proxy functionality, so the project name should be changed in the future. @@ -18,30 +19,3 @@ kubectl apply -f "https://github.com/kubevirt/vm-console-proxy/releases/latest/d ## API See the [API documentation](docs/api.md). - -## Exposing the service - -The `Service` is not exposed by default, because the `Ingress` configuration -can depend on the cluster where it is running. For example this `Ingress` can be used: - -[//]: # (TODO: This ingress currently does not work with OpenShit. Look into why.) - -```yaml -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: vm-console - namespace: ${VM_CONSOLE_PROXY_NAMESPACE} -spec: - rules: - - host: ${HOSTNAME} - http: - paths: - - backend: - service: - name: vm-console-proxy - port: - number: 443 - path: / - pathType: Prefix -``` diff --git a/docs/api.md b/docs/api.md index 4109eae4..8ba8c630 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,14 +1,10 @@ # API -The commands in this document use environment variable `PROXY_URL`, -which should be set to the URL where the `vm-console-proxy` service is -exposed to the outside of the cluster. - ## Generate a token A temporary token can be generated using: ``` -GET /api/v1alpha1/${VMI_NAMESPACE}/${VMI_NAME}/token +GET /apis/token.kubevirt.io/v1alpha1/namespaces/${VMI_NAMESPACE}/virtualmachines/${VMI_NAME}/vnc ``` Where `${VMI_NAMESPACE}` and `${VMI_NAME}` are the namespace and name of a running VMI. @@ -16,10 +12,6 @@ and name of a running VMI. #### Parameters - `duration` - Duration while the token is valid -#### Headers -- `Authorization` - Contains Bearer token that is used to check - RBAC permissions to access `/vnc` subresource on a VMI - #### Result Result is a JSON object containing the token: ```json @@ -29,7 +21,7 @@ Result is a JSON object containing the token: ### Example ```bash curl --header "Authorization: Bearer ${KUBERNETES_USER_TOKEN}" \ - "https://${PROXY_URL}/api/v1alpha1/${VMI_NAMESPACE}/${VMI_NAME}/token?duration=${DURATION}" + "https://${K8S_API_URL}/apis/token.kubevirt.io/v1alpha1/namespaces/${VMI_NAMESPACE}/virtualmachines/${VMI_NAME}/vnc?duration=${DURATION}" ``` The `KUBERNETES_USER_TOKEN` variable is a bearer token used to authenticate with