default List<LocalObjectReference> getImagePullSecrets(ServiceSettings settings) { List<LocalObjectReference> imagePullSecrets = new ArrayList<>(); if (settings.getKubernetes().getImagePullSecrets()!= null) { for (String imagePullSecret : settings.getKubernetes().getImagePullSecrets()) { imagePullSecrets.add(new LocalObjectReference(imagePullSecret)); } } return imagePullSecrets; }
default List<LocalObjectReference> getImagePullSecrets(ServiceSettings settings) { List<LocalObjectReference> imagePullSecrets = new ArrayList<>(); if (settings.getKubernetes().getImagePullSecrets()!= null) { for (String imagePullSecret : settings.getKubernetes().getImagePullSecrets()) { imagePullSecrets.add(new LocalObjectReference(imagePullSecret)); } } return imagePullSecrets; }
.addBinding("initContainers", getInitContainers(details)) .addBinding("hostAliases", getHostAliases(details)) .addBinding("imagePullSecrets", settings.getKubernetes().getImagePullSecrets()) .addBinding("serviceAccountName", settings.getKubernetes().getServiceAccountName()) .addBinding("terminationGracePeriodSeconds", terminationGracePeriodSeconds()) .addBinding("nodeSelector", settings.getKubernetes().getNodeSelector()) .addBinding("volumes", combineVolumes(configSources, settings.getKubernetes(), sidecarConfigs)) .toString();
default String getServiceYaml(GenerateService.ResolvedConfiguration resolvedConfiguration) { ServiceSettings settings = resolvedConfiguration.getServiceSettings(getService()); String namespace = getNamespace(settings); TemplatedResource service = new JinjaJarResource("/kubernetes/manifests/service.yml"); service.addBinding("name", getService().getCanonicalName()); service.addBinding("namespace", namespace); service.addBinding("port", settings.getPort()); service.addBinding("type", settings.getKubernetes().getServiceType()); service.addBinding("nodePort", settings.getKubernetes().getNodePort()); return service.toString(); }
.addBinding("replicas", targetSize) .addBinding("version", version) .addBinding("podAnnotations", settings.getKubernetes().getPodAnnotations()) .addBinding("podSpec", podSpec.toString()) .toString();
}).collect(Collectors.toList()); volumeMounts.addAll(settings.getKubernetes().getVolumes().stream() .map(c -> { TemplatedResource volume = new JinjaJarResource("/kubernetes/manifests/volumeMount.yml");
default String getResourceYaml(KubernetesV2Executor executor, AccountDeploymentDetails<KubernetesAccount> details, GenerateService.ResolvedConfiguration resolvedConfiguration) { ServiceSettings settings = resolvedConfiguration.getServiceSettings(getService()); Integer targetSize = settings.getTargetSize(); CustomSizing customSizing = details.getDeploymentConfiguration().getDeploymentEnvironment().getCustomSizing(); if (customSizing != null) { Map componentSizing = customSizing.getOrDefault(getService().getServiceName(), new HashMap()); targetSize = (Integer) componentSizing.getOrDefault("replicas", targetSize); } String version = makeValidLabel(details.getDeploymentConfiguration().getVersion()); if (version.isEmpty()) { version = "unknown"; } return new JinjaJarResource("/kubernetes/manifests/deployment.yml") .addBinding("name", getService().getCanonicalName()) .addBinding("namespace", getNamespace(settings)) .addBinding("replicas", targetSize) .addBinding("version", version) .addBinding("podAnnotations", settings.getKubernetes().getPodAnnotations()) .addBinding("podSpec", getPodSpecYaml(executor, details, resolvedConfiguration)) .toString(); }
description.setPodAnnotations(settings.getKubernetes().getPodAnnotations());
description.setPodAnnotations(settings.getKubernetes().getPodAnnotations()); description.setNodeSelector(deploymentEnvironment.getNodeSelectors());
.withNewTemplate() .withNewMetadata() .withAnnotations(settings.getKubernetes().getPodAnnotations()) .withLabels(podLabels) .endMetadata()
.withNewTemplate() .withNewMetadata() .withAnnotations(settings.getKubernetes().getPodAnnotations()) .withLabels(podLabels) .endMetadata()