Kubernetes

Setting up

Add the following dependency to your project:

<dependency>
  <groupId>io.dekorate</groupId>
  <artifactId>kubernetes-annotations</artifactId>
  <version>1.0.0</version>
</dependency>

Then add the @Dekorate annotation to one of your Java source files.

package org.acme;

import io.dekorate.annotation.Dekorate;

@Dekorate
public class Application {
}

Note: It doesn’t have to be the Main class. Next time you perform a build, using something like:

Building

mvn clean package

The generated manifests can be found under target/classes/META-INF/dekorate.

Screencast

asciicast

Configuration styles

The generated manifests can be customized either using annotations or configuration properties/yml.

Using annotations

The @KubernetesApplication under io.dekorate.kubernetes.annotation is a @Dekorate alternative through which the user can specify all sorts of customization, For example to set the replicas to 2:

package org.acme;

import io.dekorate.kubernetes.annotation.KubernetesApplication;

@KubernetesApplication(replicas=2)
public class Application {
}

Using framework configuration

The same can be achieved using plain old configuration (e.g.application.properties):

dekorate.kubernetes.replicas=2

**A complete reference on all the supported properties can be found in the configuration options guide.