Created
January 22, 2018 11:38
-
-
Save tombentley/761add91fba79310adeca8c50aeec0bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StatefulSet statefulSet = new StatefulSetBuilder() | |
.withNewMetadata() | |
.withName(name) | |
.withLabels(getLabelsWithName()) | |
.withNamespace(namespace) | |
.endMetadata() | |
.withNewSpec() | |
.withPodManagementPolicy("Parallel") | |
.withUpdateStrategy(new StatefulSetUpdateStrategyBuilder().withType("OnDelete").build()) | |
.withSelector(new LabelSelectorBuilder().withMatchLabels(getLabelsWithName()).build()) | |
.withServiceName(headlessName) | |
.withReplicas(replicas) | |
.withNewTemplate() | |
.withNewMetadata() | |
.withName(name) | |
.withLabels(getLabelsWithName()) | |
.withAnnotations(getPrometheusAnnotations()) | |
.endMetadata() | |
.withNewSpec() | |
.withSecurityContext(securityContext) | |
.withInitContainers(initContainers) | |
.withContainers(container) | |
.withVolumes(volumes) | |
.endSpec() | |
.endTemplate() | |
.withVolumeClaimTemplates(volumeClaims) | |
.endSpec() | |
.build(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment