当前位置: 首页>>代码示例>>Java>>正文


Java IntOrString类代码示例

本文整理汇总了Java中io.fabric8.kubernetes.api.model.IntOrString的典型用法代码示例。如果您正苦于以下问题:Java IntOrString类的具体用法?Java IntOrString怎么用?Java IntOrString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IntOrString类属于io.fabric8.kubernetes.api.model包,在下文中一共展示了IntOrString类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRuntimeEndpoint

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
public OpenShiftRuntimeEndpoint getRuntimeEndpoint(String id) throws OpenShiftClientException {
    try {
        OpenShiftRuntimeId runtimeId = OpenShiftRuntimeId.fromString(id);
        String prjName = runtimeId.project();
        String svcName = runtimeId.service();
        OpenShiftRuntimeEndpoint endpoint = new OpenShiftRuntimeEndpoint();
        Route route = delegate.routes().inNamespace(prjName).withName(svcName).get();
        if (route != null) {
            RouteSpec routeSpec = route.getSpec();
            endpoint.setProtocol(routeSpec.getTls() != null ? "https" : "http");
            endpoint.setHost(routeSpec.getHost());
            RoutePort routePort = routeSpec.getPort();
            if (routePort != null) {
                IntOrString targetPort = routePort.getTargetPort();
                if (targetPort != null) {
                    endpoint.setPort(targetPort.getIntVal());
                }
            }
        }
        return endpoint;
    } catch (Throwable t) {
        throw new OpenShiftClientException(t.getMessage(), t);
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:25,代码来源:OpenShiftClient.java

示例2: createServiceSpec

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
protected ServiceSpec createServiceSpec(final Map<String, String> labels) {
  final ServiceSpec serviceSpec = new ServiceSpec();
  serviceSpec.setType("ClusterIP");

  final ServicePort servicePort = new ServicePort();
  servicePort.setName(DEFAULT_NAME);
  servicePort.setPort(Integer.valueOf(44134));
  servicePort.setTargetPort(new IntOrString(DEFAULT_NAME));
  serviceSpec.setPorts(Arrays.asList(servicePort));

  serviceSpec.setSelector(normalizeLabels(labels));
  return serviceSpec;
}
 
开发者ID:microbean,项目名称:microbean-helm,代码行数:14,代码来源:TillerInstaller.java

示例3: getPort

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
private IntOrString getPort() {
	IntOrStringBuilder builder = new IntOrStringBuilder();
	if (StringUtils.isNumeric(port)) {
		builder.withIntVal(Integer.valueOf(port));
	} else {
		builder.withStrVal(port);
	}
	return builder.build();
}
 
开发者ID:xtf-cz,项目名称:xtf,代码行数:10,代码来源:AbstractProbe.java

示例4: configureDatastore

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
static DeploymentConfigBuilder configureDatastore(final ApplicationBuilder appBuilder) {
	final DeploymentConfigBuilder cassandra = appBuilder.deploymentConfig("middleware-manager-datastore", "middleware-manager-datastore", false);

	cassandra
			.onConfigurationChange()
			.podTemplate()
			.container()
			.fromImage(ImageRegistry.get().midlewareManagerStorage())
			.envVar("CASSANDRA_START_RPC", "true")
			.port(9042, "cql-port")
			.port(9160, "thift-port")
			.port(7000, "tcp-port")
			.port(7001, "ssl-port")
			.port(7199, "jmx-port")
			.addVolumeMount("cassandra-data", "/opt/apache-cassandra/data", false)
			.pod()
			.addEmptyDirVolume("cassandra-data").container()
			.addReadinessProbe().createTcpProbe("7000");

	appBuilder.service("middleware-manager-datastore")
			.addContainerSelector("name", "middleware-manager-datastore")
			.ports(new ServicePortBuilder().withName("cql-port").withPort(9042).withTargetPort(new IntOrString("cql-port")).build(),
					new ServicePortBuilder().withName("thift-port").withPort(9160).withTargetPort(new IntOrString("thift-port")).build(),
					new ServicePortBuilder().withName("tcp-port").withPort(7000).withTargetPort(new IntOrString("tcp-port")).build(),
					new ServicePortBuilder().withName("ssl-port").withPort(7001).withTargetPort(new IntOrString("ssl-port")).build(),
					new ServicePortBuilder().withName("jmx-port").withPort(7199).withTargetPort(new IntOrString("jmx-port")).build()
			);

	return cassandra;
}
 
开发者ID:xtf-cz,项目名称:xtf,代码行数:31,代码来源:MiddlewareManagerUtil.java

示例5: createContainer

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
protected Container createContainer(final String imageName,
                                    final ImagePullPolicy imagePullPolicy,
                                    final String namespace,
                                    final boolean tls,
                                    final boolean verifyTls) {
  final Container container = new Container();
  container.setName(DEFAULT_NAME);
  container.setImage(normalizeImageName(imageName));
  container.setImagePullPolicy(normalizeImagePullPolicy(imagePullPolicy));

  final ContainerPort containerPort = new ContainerPort();
  containerPort.setContainerPort(Integer.valueOf(44134));
  containerPort.setName(DEFAULT_NAME);
  container.setPorts(Arrays.asList(containerPort));

  final List<EnvVar> env = new ArrayList<>();
  
  final EnvVar tillerNamespace = new EnvVar();
  tillerNamespace.setName("TILLER_NAMESPACE");
  tillerNamespace.setValue(normalizeNamespace(namespace));
  env.add(tillerNamespace);

  if (tls) {
    final EnvVar tlsVerify = new EnvVar();
    tlsVerify.setName("TILLER_TLS_VERIFY");
    tlsVerify.setValue(verifyTls ? "1" : "");
    env.add(tlsVerify);
    
    final EnvVar tlsEnable = new EnvVar();
    tlsEnable.setName("TILLER_TLS_ENABLE");
    tlsEnable.setValue("1");
    env.add(tlsEnable);

    final EnvVar tlsCerts = new EnvVar();
    tlsCerts.setName("TILLER_TLS_CERTS");
    tlsCerts.setValue(TILLER_TLS_CERTS_PATH);
    env.add(tlsCerts);
  }
  
  container.setEnv(env);
  

  final IntOrString port44135 = new IntOrString(Integer.valueOf(44135));
  
  final HTTPGetAction livenessHttpGetAction = new HTTPGetAction();
  livenessHttpGetAction.setPath("/liveness");
  livenessHttpGetAction.setPort(port44135);
  final Probe livenessProbe = new Probe();
  livenessProbe.setHttpGet(livenessHttpGetAction);
  livenessProbe.setInitialDelaySeconds(ONE);
  livenessProbe.setTimeoutSeconds(ONE);
  container.setLivenessProbe(livenessProbe);

  final HTTPGetAction readinessHttpGetAction = new HTTPGetAction();
  readinessHttpGetAction.setPath("/readiness");
  readinessHttpGetAction.setPort(port44135);
  final Probe readinessProbe = new Probe();
  readinessProbe.setHttpGet(readinessHttpGetAction);
  readinessProbe.setInitialDelaySeconds(ONE);
  readinessProbe.setTimeoutSeconds(ONE);
  container.setReadinessProbe(readinessProbe);

  if (tls) {
    final VolumeMount volumeMount = new VolumeMount();
    volumeMount.setName(DEFAULT_NAME + "-certs");
    volumeMount.setReadOnly(true);
    volumeMount.setMountPath(TILLER_TLS_CERTS_PATH);
    container.setVolumeMounts(Arrays.asList(volumeMount));
  }

  return container;
}
 
开发者ID:microbean,项目名称:microbean-helm,代码行数:73,代码来源:TillerInstaller.java

示例6: withTargetPort

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
private RouteBuilder withTargetPort(String targetPortName) {
  this.targetPort = new IntOrString(targetPortName);
  return this;
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:ServerExposer.java

示例7: intOrString

import io.fabric8.kubernetes.api.model.IntOrString; //导入依赖的package包/类
private static IntOrString intOrString(int port) {
  return new IntOrStringBuilder().withIntVal(port).withStrVal(String.valueOf(port)).build();
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:OpenShiftInternalRuntimeTest.java


注:本文中的io.fabric8.kubernetes.api.model.IntOrString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。