Closed kieron-dev closed 3 years ago
Getting the workstation ready, assuming we don't want this in eirini-station:
sudo apt get default-jdk
- going for the default of java v11, as this is in LTS and things don't compile in v16, it seems...sudo apt get maven
git clone https://github.com/cloudfoundry/cf-java-client
cd cf-java-client
gsu
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
./mvnw clean install -DskipTests
./mvnw dependency:resolve
./mvnw dependency:resolve -Dclassifier=sources
git clone https://github.com/kubernetes-client/java k8s-java-client
cd k8s-java-client
./mvnw clean install -DskipTests
./mvnw dependency:resolve
./mvnw dependency:resolve -Dclassifier=sources
Then in nvim, :CocInstall coc-java
will install a java LSP. Might be based on running eclipse in the background though! I've had better performance from using the build-in lsp: https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#java_language_server.
Some notes on k8s java client. Importantly, pinniped is NOT supported, as it uses a client-go Exec Credentials plugin that returns a client certificate / key pair.
provide
method taking the apiClient
Some notes on cf-java-client.
Back to the k8s client:
~/.kube/config
This is used by the KubeConfigAuthentication object mentioned above, but has the benefit of not wrapping up the token up with the apiClient, meaning we can use this directly in a new cf-java-client TokenProvider.
It still has the problem mentioned above that exec credential plugins returning certificates will not be supported.
Closing this exploration now.
Findings:
With the CF CLI, we found we could use pieces of client-go to authenticate exactly the same was as kubectl does.
Explore whether an analogue is possible using the cf-java-client, borrowing authentication mechanisms from the official java k8s client.
Outcomes: