Skip to content

Instantly share code, notes, and snippets.

@iocanel
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iocanel/60a90261b8dc6f6fa08e to your computer and use it in GitHub Desktop.
Save iocanel/60a90261b8dc6f6fa08e to your computer and use it in GitHub Desktop.
Kubernetes Service with Java Fluent Builder
Service srv = new ServiceBuilder()
.withNewMetadata()
.withName("kubernetes")
.addToLabels("component", "apiserver")
.addToLabels("provider", "kubernetes")
.endMetadata()
.withNewSpec()
.addNewPort()
.withProtocol("TCP")
.withPort(443)
.withNewTargetPort(443)
.endPort()
.withPortalIP("172.30.17.2")
.withSessionAffinity("None")
.endSpec()
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment