@@ -36,22 +36,26 @@ import (
36
36
)
37
37
38
38
var (
39
- logLevel string
40
- masterURL string
41
- kubeconfig string
42
- namespace string
43
- location * time.Location
44
- clientQPS float64
45
- clientBurst int
46
- mlPipelineAPIServerName string
47
- mlPipelineServiceGRPCPort string
39
+ logLevel string
40
+ masterURL string
41
+ kubeconfig string
42
+ namespace string
43
+ location * time.Location
44
+ clientQPS float64
45
+ clientBurst int
46
+ mlPipelineAPIServerName string
47
+ mlPipelineServiceGRPCPort string
48
+ mlPipelineServiceTLSEnabled bool
49
+ mlPipelineServiceTLSCert string
48
50
)
49
51
50
52
const (
51
53
// These flags match the persistence agent
52
54
mlPipelineAPIServerBasePathFlagName = "mlPipelineAPIServerBasePath"
53
55
mlPipelineAPIServerNameFlagName = "mlPipelineAPIServerName"
54
56
mlPipelineAPIServerGRPCPortFlagName = "mlPipelineServiceGRPCPort"
57
+ mlPipelineServiceTLSEnabledFlagName = "mlPipelineServiceTLSEnabled"
58
+ mlPipelineServiceTLSCertFlagName = "mlPipelineServiceTLSCert"
55
59
apiTokenFile = "/var/run/secrets/kubeflow/tokens/scheduledworkflow-sa-token"
56
60
)
57
61
@@ -102,7 +106,7 @@ func main() {
102
106
grpcAddress := fmt .Sprintf ("%s:%s" , mlPipelineAPIServerName , mlPipelineServiceGRPCPort )
103
107
104
108
log .Infof ("Connecting the API server over GRPC at: %s" , grpcAddress )
105
- apiConnection , err := commonutil .GetRpcConnectionWithTimeout (grpcAddress , time .Now ().Add (time .Minute ))
109
+ apiConnection , err := commonutil .GetRpcConnectionWithTimeout (grpcAddress , mlPipelineServiceTLSEnabled , mlPipelineServiceTLSCert , time .Now ().Add (time .Minute ))
106
110
if err != nil {
107
111
log .Fatalf ("Error connecting to the API server after trying for one minute: %v" , err )
108
112
}
@@ -160,6 +164,8 @@ func init() {
160
164
flag .Float64Var (& clientQPS , "clientQPS" , 5 , "The maximum QPS to the master from this client." )
161
165
flag .StringVar (& mlPipelineAPIServerName , mlPipelineAPIServerNameFlagName , "ml-pipeline" , "Name of the ML pipeline API server." )
162
166
flag .StringVar (& mlPipelineServiceGRPCPort , mlPipelineAPIServerGRPCPortFlagName , "8887" , "GRPC Port of the ML pipeline API server." )
167
+ flag .BoolVar (& mlPipelineServiceTLSEnabled , mlPipelineServiceTLSEnabledFlagName , false , "TLS enabled in the ML pipeline API server." )
168
+ flag .StringVar (& mlPipelineServiceTLSCert , mlPipelineServiceTLSCertFlagName , "" , "CA cert to connect to the ML pipeline API server." )
163
169
flag .IntVar (& clientBurst , "clientBurst" , 10 , "Maximum burst for throttle from this client." )
164
170
var err error
165
171
location , err = util .GetLocation ()
0 commit comments