io.fabric8.kubernetes.api.model.Service.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中io.fabric8.kubernetes.api.model.Service.<init>()方法的一些代码示例,展示了Service.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Service.<init>()方法的具体详情如下:
包路径:io.fabric8.kubernetes.api.model.Service
类名称:Service
方法名:<init>

Service.<init>介绍

[英]No args constructor for use in serialization
[中]没有用于序列化的args构造函数

代码示例

代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model

public ServiceBuilder(){
  this(new Service());
}
public ServiceBuilder( ServiceFluent<?> fluent ){

代码示例来源:origin: org.domeos/kubernetes-model

public ServiceBuilder(ServiceFluent<?> fluent,Boolean validationEnabled){
    this(fluent, new Service(), validationEnabled);
}
public ServiceBuilder(ServiceFluent<?> fluent,Service instance){

代码示例来源:origin: org.apache.stratos/kubernetes-model

public ServiceBuilder(){
  this(new Service());
}
public ServiceBuilder( ServiceFluent<?> fluent ){

代码示例来源:origin: org.apache.stratos/kubernetes-model

public ServiceBuilder( ServiceFluent<?> fluent ){
  this(fluent, new Service());
}
public ServiceBuilder( ServiceFluent<?> fluent , Service instance ){

代码示例来源:origin: org.domeos/kubernetes-model

public ServiceBuilder(Boolean validationEnabled){
    this(new Service(), validationEnabled);
}
public ServiceBuilder(ServiceFluent<?> fluent){

代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model

public ServiceBuilder( ServiceFluent<?> fluent ){
  this(fluent, new Service());
}
public ServiceBuilder( ServiceFluent<?> fluent , Service instance ){

代码示例来源:origin: fabric8io/jube

protected Service createService(String hostName, String port) {
  Service service = new Service();
  ServiceSpec spec = getOrCreateSpec(service);
  try {
    Integer portNumber = Integer.parseInt(port);
    if (portNumber != null) {
      List<ServicePort> ports = new ArrayList<>();
      ServicePort servicePort = new ServicePort();
      servicePort.setPort(portNumber);
      IntOrString containerPort = new IntOrString();
      containerPort.setIntVal(portNumber);
      servicePort.setTargetPort(containerPort);
      ports.add(servicePort);
      spec.setPorts(ports);
    }
  } catch (NumberFormatException e) {
    LOG.warn("Failed to parse port text: " + port + ". " + e, e);
  }
  spec.setPortalIP(hostName);
  return service;
}

代码示例来源:origin: org.domeos/kubernetes-model

public Service build(){
    Service buildable = new Service(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus());
    validate(buildable);
    return buildable;
}

代码示例来源:origin: org.apache.stratos/kubernetes-model

public Service build(){
  Service buildable = new Service(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus());
validate(buildable);
return buildable;

}

代码示例来源:origin: org.microbean/microbean-helm

protected Service createService(final String namespace,
                final String serviceName,
                Map<String, String> labels) {
 labels = normalizeLabels(labels);
 final Service service = new Service();
 
 final ObjectMeta metadata = new ObjectMeta();
 metadata.setNamespace(normalizeNamespace(namespace));
 metadata.setName(normalizeServiceName(serviceName));
 metadata.setLabels(labels);
 
 service.setMetadata(metadata);
 service.setSpec(this.createServiceSpec(labels));
 return service;
}

代码示例来源:origin: microbean/microbean-helm

protected Service createService(final String namespace,
                final String serviceName,
                Map<String, String> labels) {
 labels = normalizeLabels(labels);
 final Service service = new Service();
 
 final ObjectMeta metadata = new ObjectMeta();
 metadata.setNamespace(normalizeNamespace(namespace));
 metadata.setName(normalizeServiceName(serviceName));
 metadata.setLabels(labels);
 
 service.setMetadata(metadata);
 service.setSpec(this.createServiceSpec(labels));
 return service;
}

代码示例来源:origin: io.vertx/vertx-service-discovery-bridge-kubernetes

private Service getService96() {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service-type", "http-endpoint");
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("hello-minikube");
 metadata.setUid("37c57c1e-deb0-11e8-a8ee-0800274f8294");
 metadata.setNamespace("issue96");
 metadata.setLabels(labels);
 metadata.getAdditionalProperties().put("run", "hello-minikube");
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(80));
 port.setPort(8080);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: io.vertx/vertx-service-discovery-bridge-kubernetes

private Service getHttpService() {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service-type", "http-endpoint");
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid");
 metadata.setNamespace("my-project");
 metadata.setLabels(labels);
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(80));
 port.setPort(8080);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: vert-x3/vertx-service-discovery

private Service getHttpService() {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service-type", "http-endpoint");
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid");
 metadata.setNamespace("my-project");
 metadata.setLabels(labels);
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(80));
 port.setPort(8080);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: io.vertx/vertx-service-discovery-bridge-kubernetes

private Service getHttpService() {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service-type", "http-endpoint");
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-http-service");
 metadata.setUid("uuid-1");
 metadata.setNamespace("my-project");
 metadata.setLabels(labels);
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(80));
 port.setPort(8080);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: vert-x3/vertx-service-discovery

private Service getHttpService() {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service-type", "http-endpoint");
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-http-service");
 metadata.setUid("uuid-1");
 metadata.setNamespace("my-project");
 metadata.setLabels(labels);
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(80));
 port.setPort(8080);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: io.vertx/vertx-service-discovery-bridge-kubernetes

private Service getSimpleService() {
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid-2");
 metadata.setNamespace("my-project");
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(8080));
 port.setPort(1524);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: io.vertx/vertx-service-discovery-bridge-kubernetes

private Service getExternalService(int port) {
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid");
 metadata.setNamespace("my-project");
 ServiceSpec serviceSpec = new ServiceSpec();
 ServicePort servicePort = new ServicePort();
 servicePort.setPort(port);
 serviceSpec.setType("ExternalName");
 serviceSpec.setExternalName("my-external-service");
 serviceSpec.setPorts(Collections.singletonList(servicePort));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(serviceSpec);
 return service;
}

代码示例来源:origin: vert-x3/vertx-service-discovery

private Service getSimpleService() {
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid-2");
 metadata.setNamespace("my-project");
 ServiceSpec spec = new ServiceSpec();
 ServicePort port = new ServicePort();
 port.setTargetPort(new IntOrString(8080));
 port.setPort(1524);
 spec.setPorts(Collections.singletonList(port));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(spec);
 return service;
}

代码示例来源:origin: vert-x3/vertx-service-discovery

private Service getExternalService(int port) {
 ObjectMeta metadata = new ObjectMeta();
 metadata.setName("my-service");
 metadata.setUid("uuid");
 metadata.setNamespace("my-project");
 ServiceSpec serviceSpec = new ServiceSpec();
 ServicePort servicePort = new ServicePort();
 servicePort.setPort(port);
 serviceSpec.setType("ExternalName");
 serviceSpec.setExternalName("my-external-service");
 serviceSpec.setPorts(Collections.singletonList(servicePort));
 Service service = new Service();
 service.setMetadata(metadata);
 service.setSpec(serviceSpec);
 return service;
}

相关文章