Skip to content

Commit f8bb2cb

Browse files
committed
add tls bundle to auth
1 parent 8f818e4 commit f8bb2cb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/auth/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func main() {
3838
client.WithKubeconfig(args.KubeconfigPath()),
3939
client.WithMasterUrl(args.ApiServerHost()),
4040
client.WithInsecureTLSSkipVerify(args.ApiServerSkipTLSVerify()),
41+
client.WithCaBundle(args.ApiServerCaBundle()),
4142
)
4243

4344
klog.V(1).InfoS("Listening and serving insecurely on", "address", args.Address())

modules/auth/pkg/args/args.go

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var (
3131
argKubeconfig = pflag.String("kubeconfig", "", "path to kubeconfig file")
3232
argApiServerHost = pflag.String("apiserver-host", "", "address of the Kubernetes API server to connect to in the format of protocol://address:port, leave it empty if the binary runs inside cluster for local discovery attempt")
3333
argApiServerSkipTLSVerify = pflag.Bool("apiserver-skip-tls-verify", false, "enable if connection with remote Kubernetes API server should skip TLS verify")
34+
argApiServerCaBundle = pflag.String("apiserver-ca-bundle", "", "file containing the x509 certificates used for HTTPS connection to the API Server")
3435
)
3536

3637
func init() {
@@ -59,6 +60,10 @@ func ApiServerSkipTLSVerify() bool {
5960
return *argApiServerSkipTLSVerify
6061
}
6162

63+
func ApiServerCaBundle() string {
64+
return *argApiServerCaBundle
65+
}
66+
6267
func Address() string {
6368
return fmt.Sprintf("%s:%d", *argAddress, *argPort)
6469
}

0 commit comments

Comments
 (0)