This plugin adds the logging view into the 'observe' menu in the OpenShift console. It requires OpenShift 4.10.
This plugin connects to a loki backend, you can install the loki-operator in your cluster.
Node.js and npm are required to build and run the plugin. To run OpenShift console in a container, either Docker or podman 3.2.0+ and oc are required.
Make sure you have loki running on http://localhost:3100
In one terminal window, run:
npm installnpm run dev
In another terminal window, run:
oc login(requires oc and an OpenShift cluster)npm run start:console(requires Docker or podman 3.2.0+)
This will create an environment file scripts/env.list and run the OpenShift console
in a container connected to the cluster you've logged into. The plugin HTTP server
runs on port 9001 with CORS enabled.
The dynamic console plugin is configured to connect to loki using a proxy
/api/proxy/plugin/logging-view-plugin/backend/, in local mode this will point
to http://localhost:3100. You can disable this by re-running the console with
npm run start:console -c to use the cluster proxy
Navigate to http://localhost:9000/monitoring/logs to see the running plugin.
If you are using podman on a Mac with Apple silicon, npm run start:console
might fail since it runs an amd64 image. You can workaround the problem with
qemu-user-static by running
these commands:
podman machine ssh
sudo -i
rpm-ostree install qemu-user-static
systemctl rebootnpm run test:unitIn order to run the e2e tests, you need first to build the plugin in standalone mode
npm run build:standalone:instrumentedand then run the cypress tests
npm run test:e2eYou can deploy the plugin to a cluster by instantiating the provided Plugin Resources. It will use the latest plugin docker image and run a light-weight nginx HTTP server to serve the plugin's assets.
oc create -f logging-view-plugin-resources.ymlOnce deployed, patch the Console operator config to enable the plugin.
oc patch consoles.operator.openshift.io cluster \
--patch '{ "spec": { "plugins": ["logging-view-plugin"] } }' --type=merge./scripts/image.sh -t latest