Tuesday, March 12, 2019

IntelliJ, Eclipse and Java 11


you must install IDEA 2018.2 or greater. 2018.1 will not work, it supports only Java 10. It's a 500 MB monster so be patient.

https://www.jetbrains.com/idea/download/ download 2018.3.5 here

then configure the platform JDK with your installed JDK 11 (of course you must have installed this JDK from Oracle or OpenJDK!), with ALT-SHIFT-CONTROL-S (project structure/SDKs)

then configure Java 11 level (File/Project Structure/Modules and File/Project Structure/Project)

also don't forget the bytecode level (File/Settings/Java Compiler):

If you get the "invalid source release: 11" , it's possible that you misconfigured the "platform JDK"

For Eclipse it's much easier: install Eclipse 2018-09 (4.9), then install this add-on:


make sure you configure the JDK in the "installed JRA" preferences tab,

and when you create a new project, select jdk11 and create the module-info by default.
All works fine.

Monday, March 11, 2019

yipee.io, the online kubernetes yaml generator

I agree with every word written here:


beyond a very basic deployment, working directly with yaml files is suicidal.

I will explore this yipee and see if I can use it regularly, as replacement for a really primitive "vi mypod.yml"

Sunday, March 10, 2019

Kubernetes Java client to generate yaml files for you

If you - like me - hate having to type YAML by hand, you can take advantage of a pre-build K8S Model and YAML serialization tool:



import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.internal.SerializationUtils;

public class KubernetesClientTest {
 public static void main(String[] args) throws JsonProcessingException {
  String yaml = SerializationUtils.dumpAsYaml(new DeploymentBuilder().withNewSpec().endSpec().build());
  KubernetesClient client = new DefaultKubernetesClient();
  Pod pod = new Pod();
  String podyaml = SerializationUtils.dumpAsYaml(pod);


The model is incredibly rich.... one has only to learn how to use it...