@Override public void contribute(Builder builder) { try { Pod current = utils.currentPod().get(); Map<String, Object> details = new HashMap<>(); if (current != null) { details.put("inside", true); details.put("namespace", current.getMetadata().getNamespace()); details.put("podName", current.getMetadata().getName()); details.put("podIp", current.getStatus().getPodIP()); details.put("serviceAccount", current.getSpec().getServiceAccountName()); details.put("nodeName", current.getSpec().getNodeName()); details.put("hostIp", current.getStatus().getHostIP()); } else { details.put("inside", false); } builder.withDetail("kubernetes", details); } catch (Exception e) { LOG.warn("Failed to get pod details", e); } } }
@Override protected void doHealthCheck(Health.Builder builder) throws Exception { try { Pod current = utils.currentPod().get(); if (current != null) { builder.up().withDetail("inside", true) .withDetail("namespace", current.getMetadata().getNamespace()) .withDetail("podName", current.getMetadata().getName()) .withDetail("podIp", current.getStatus().getPodIP()) .withDetail("serviceAccount", current.getSpec().getServiceAccountName()) .withDetail("nodeName", current.getSpec().getNodeName()) .withDetail("hostIp", current.getStatus().getHostIP()); } else { builder.up().withDetail("inside", false); } } catch (Exception e) { builder.down(e); } } }
@Override protected void doHealthCheck(Health.Builder builder) throws Exception { try { Pod current = utils.currentPod().get(); if (current != null) { builder.up() .withDetail("inside", true) .withDetail("namespace", current.getMetadata().getNamespace()) .withDetail("podName", current.getMetadata().getName()) .withDetail("podIp", current.getStatus().getPodIP()) .withDetail("serviceAccount", current.getSpec().getServiceAccountName()) .withDetail("nodeName", current.getSpec().getNodeName()) .withDetail("hostIp", current.getStatus().getHostIP()); } else { builder.up() .withDetail("inside", false); } } catch (Exception e) { builder.down(e); } } }
@Override public void contribute(Builder builder) { try { Pod current = utils.currentPod().get(); Map<String, Object> details = new HashMap<>(); if (current != null) { details.put("inside", true); details.put("namespace", current.getMetadata().getNamespace()); details.put("podName", current.getMetadata().getName()); details.put("podIp", current.getStatus().getPodIP()); details.put("serviceAccount", current.getSpec().getServiceAccountName()); details.put("nodeName", current.getSpec().getNodeName()); details.put("hostIp", current.getStatus().getHostIP()); } else { details.put("inside", false); } builder.withDetail("kubernetes", details); } catch (Exception e) { LOG.warn("Failed to get pod details", e); } } }
n.put("schedulerName", spec.getSchedulerName()); n.put("serviceAccount", spec.getServiceAccount()); n.put("serviceAccountName", spec.getServiceAccountName()); n.put("subdomain", spec.getSubdomain()); n.put("terminationGracePeriodSeconds", spec.getTerminationGracePeriodSeconds());
log.status("Applying pod:" + getName(pod)); Set<Secret> secrets = generateSecrets(client, session, pod.getMetadata()); String serviceAccountName = pod.getSpec().getServiceAccountName(); if (Strings.isNotBlank(serviceAccountName)) { generateServiceAccount(client, session, secrets, serviceAccountName); log.status("Applying replication controller:" + getName(replicationController)); Set<Secret> secrets = generateSecrets(client, session, replicationController.getSpec().getTemplate().getMetadata()); String serviceAccountName = replicationController.getSpec().getTemplate().getSpec().getServiceAccountName(); if (Strings.isNotBlank(serviceAccountName)) { generateServiceAccount(client, session, secrets, serviceAccountName);
@Override protected void doHealthCheck(Health.Builder builder) throws Exception { try { Pod current = utils.currentPod().get(); if (current != null) { builder.up() .withDetail("inside", true) .withDetail("podName", current.getMetadata().getName()) .withDetail("podIp", current.getStatus().getPodIP()) .withDetail("serviceAccount", current.getSpec().getServiceAccountName()) .withDetail("nodeName", current.getSpec().getNodeName()) .withDetail("hostIp", current.getStatus().getHostIP()); } else { builder.up() .withDetail("inside", false); } } catch (Exception e) { builder.down(e); } } }
@Override protected void doHealthCheck(Health.Builder builder) throws Exception { try { Pod current = utils.currentPod().get(); if (current != null) { builder.up() .withDetail("inside", true) .withDetail("namespace", current.getMetadata().getNamespace()) .withDetail("podName", current.getMetadata().getName()) .withDetail("podIp", current.getStatus().getPodIP()) .withDetail("serviceAccount", current.getSpec().getServiceAccountName()) .withDetail("nodeName", current.getSpec().getNodeName()) .withDetail("hostIp", current.getStatus().getHostIP()); } else { builder.up() .withDetail("inside", false); } } catch (Exception e) { builder.down(e); } } }
@Override protected void doHealthCheck(Health.Builder builder) throws Exception { try { Pod current = utils.currentPod().get(); if (current != null) { builder.up().withDetail("inside", true) .withDetail("namespace", current.getMetadata().getNamespace()) .withDetail("podName", current.getMetadata().getName()) .withDetail("podIp", current.getStatus().getPodIP()) .withDetail("serviceAccount", current.getSpec().getServiceAccountName()) .withDetail("nodeName", current.getSpec().getNodeName()) .withDetail("hostIp", current.getStatus().getHostIP()); } else { builder.up().withDetail("inside", false); } } catch (Exception e) { builder.down(e); } } }
public PodSpecFluentImpl(PodSpec instance){ this.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds()); this.withContainers(instance.getContainers()); this.withDnsPolicy(instance.getDnsPolicy()); this.withHost(instance.getHost()); this.withHostIPC(instance.getHostIPC()); this.withHostNetwork(instance.getHostNetwork()); this.withHostPID(instance.getHostPID()); this.withHostname(instance.getHostname()); this.withImagePullSecrets(instance.getImagePullSecrets()); this.withNodeName(instance.getNodeName()); this.withNodeSelector(instance.getNodeSelector()); this.withRestartPolicy(instance.getRestartPolicy()); this.withSecurityContext(instance.getSecurityContext()); this.withServiceAccount(instance.getServiceAccount()); this.withServiceAccountName(instance.getServiceAccountName()); this.withSubdomain(instance.getSubdomain()); this.withTerminationGracePeriodSeconds(instance.getTerminationGracePeriodSeconds()); this.withVolumes(instance.getVolumes()); }
public PodSpecBuilder(PodSpec instance,Boolean validationEnabled){ this.fluent = this; this.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds()); this.withContainers(instance.getContainers()); this.withDnsPolicy(instance.getDnsPolicy()); this.withHost(instance.getHost()); this.withHostIPC(instance.getHostIPC()); this.withHostNetwork(instance.getHostNetwork()); this.withHostPID(instance.getHostPID()); this.withHostname(instance.getHostname()); this.withImagePullSecrets(instance.getImagePullSecrets()); this.withNodeName(instance.getNodeName()); this.withNodeSelector(instance.getNodeSelector()); this.withRestartPolicy(instance.getRestartPolicy()); this.withSecurityContext(instance.getSecurityContext()); this.withServiceAccount(instance.getServiceAccount()); this.withServiceAccountName(instance.getServiceAccountName()); this.withSubdomain(instance.getSubdomain()); this.withTerminationGracePeriodSeconds(instance.getTerminationGracePeriodSeconds()); this.withVolumes(instance.getVolumes()); this.validationEnabled = validationEnabled; }
public PodSpecBuilder(PodSpecFluent<?> fluent,PodSpec instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds()); fluent.withContainers(instance.getContainers()); fluent.withDnsPolicy(instance.getDnsPolicy()); fluent.withHost(instance.getHost()); fluent.withHostIPC(instance.getHostIPC()); fluent.withHostNetwork(instance.getHostNetwork()); fluent.withHostPID(instance.getHostPID()); fluent.withHostname(instance.getHostname()); fluent.withImagePullSecrets(instance.getImagePullSecrets()); fluent.withNodeName(instance.getNodeName()); fluent.withNodeSelector(instance.getNodeSelector()); fluent.withRestartPolicy(instance.getRestartPolicy()); fluent.withSecurityContext(instance.getSecurityContext()); fluent.withServiceAccount(instance.getServiceAccount()); fluent.withServiceAccountName(instance.getServiceAccountName()); fluent.withSubdomain(instance.getSubdomain()); fluent.withTerminationGracePeriodSeconds(instance.getTerminationGracePeriodSeconds()); fluent.withVolumes(instance.getVolumes()); this.validationEnabled = validationEnabled; } public PodSpecBuilder(PodSpec instance){