Kubernetes helm API 客户端文件生成和远程调用(2)

public static void main(String[] args) throws InterruptedException {
//        ManagedChannel channel = ManagedChannelBuilder.forAddress("172.16.101.200", 44134).usePlaintext(true).build();

ManagedChannel channel = NettyChannelBuilder
                .forAddress("172.16.80.151", 44134)
                .negotiationType(NegotiationType.PLAINTEXT).build();

ReleaseServiceGrpc.ReleaseServiceBlockingStub blockingStub = ReleaseServiceGrpc
                .newBlockingStub(channel).withCallCredentials(new CallCredentials(){

@Override
     public void applyRequestMetadata(MethodDescriptor<?, ?> method, Attributes attrs,
       Executor appExecutor, MetadataApplier applier) {
      // TODO Auto-generated method stub
        Metadata metadata = new Metadata();
                    metadata.put(Metadata.Key.of("x-helm-api-client", Metadata.ASCII_STRING_MARSHALLER), "v2.2.0");
                    applier.apply(metadata);
     }
                 
                });

//deployAChart(blockingStub);
        //updateDeploy(blockingStub);
        //undeploy(blockingStub);
        Tiller.GetVersionResponse response = blockingStub.getVersion(Tiller.GetVersionRequest.newBuilder().build());
        System.out.println(response.getVersion());

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/b0bcf3daa84f9e7e587839e1f80d0faf.html