Retrieve/Set V1ConfigMap with Kubernetes java client

4/6/2020

I need to retrieve a V1ConfigMap from Kubernetes using Java Client code. I read all examples here: https://github.com/kubernetes-client/java

and looked for examples in Stackoverflow and web with no luck. Basically, at deployment time, I had a folder with 4 files:

falco-config/falco.yaml
falco-config/falco_rules.local.yaml
falco-config/falco_rules.yaml
falco-config/k8s_audit_rules.yaml

and created the ConfigMap with the command:

kubectl create configmap falco-config --from-file=....../falco-config/

Now I need to retrieve it programmatically via Java client code, change the falco_rules.yaml in some way, then update it again programmatically.

Does anyone have a code snippet to retrieve/set the V1ConfigMao via Java code? Thanks in advance for the help.

-- Salvatore D'angelo
java
kubernetes

0 Answers