@@ -512,6 +512,137 @@ type BootstrapTokenDiscovery struct {
512
512
type FileDiscovery struct {
513
513
// KubeConfigPath is used to specify the actual file path or URL to the kubeconfig file from which to load cluster information
514
514
KubeConfigPath string `json:"kubeConfigPath"`
515
+
516
+ // KubeConfig is used (optionally) to generate a KubeConfig based on the KubeadmConfig's information.
517
+ // The file is generated at the path specified in KubeConfigPath.
518
+ //
519
+ // Host address (server field) information is automatically populated based on the Cluster's ControlPlaneEndpoint.
520
+ // Certificate Authority (certificate-authority-data field) is gathered from the cluster's CA secret.
521
+ //
522
+ // +optional
523
+ KubeConfig * FileDiscoveryKubeConfig `json:"kubeConfig,omitempty"`
524
+ }
525
+
526
+ // FileDiscoveryKubeConfig contains elements describing how to generate the kubeconfig for bootstrapping.
527
+ type FileDiscoveryKubeConfig struct {
528
+ // Cluster contains information about how to communicate with the kubernetes cluster.
529
+ //
530
+ // By default the following fields are automatically populated:
531
+ // - Server with the Cluster's ControlPlaneEndpoint.
532
+ // - CertificateAuthorityData with the Cluster's CA certificate.
533
+ // +optional
534
+ Cluster * KubeConfigCluster `json:"cluster,omitempty"`
535
+
536
+ // User contains information that describes identity information.
537
+ // This is used to tell the kubernetes cluster who you are.
538
+ User KubeConfigUser `json:"user"`
539
+ }
540
+
541
+ // KubeConfigCluster contains information about how to communicate with a kubernetes cluster.
542
+ //
543
+ // Adapted from clientcmdv1.Cluster.
544
+ type KubeConfigCluster struct {
545
+ // Server is the address of the kubernetes cluster (https://hostname:port).
546
+ //
547
+ // Defaults to https:// + Cluster.Spec.ControlPlaneEndpoint.
548
+ //
549
+ // +optional
550
+ Server string `json:"server,omitempty"`
551
+
552
+ // TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used.
553
+ // +optional
554
+ TLSServerName string `json:"tlsServerName,omitempty"`
555
+
556
+ // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
557
+ // +optional
558
+ InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
559
+
560
+ // CertificateAuthorityData contains PEM-encoded certificate authority certificates.
561
+ //
562
+ // Defaults to the Cluster's CA certificate if empty.
563
+ //
564
+ // +optional
565
+ CertificateAuthorityData []byte `json:"certificateAuthorityData,omitempty"`
566
+
567
+ // ProxyURL is the URL to the proxy to be used for all requests made by this
568
+ // client. URLs with "http", "https", and "socks5" schemes are supported. If
569
+ // this configuration is not provided or the empty string, the client
570
+ // attempts to construct a proxy configuration from http_proxy and
571
+ // https_proxy environment variables. If these environment variables are not
572
+ // set, the client does not attempt to proxy requests.
573
+ //
574
+ // socks5 proxying does not currently support spdy streaming endpoints (exec,
575
+ // attach, port forward).
576
+ //
577
+ // +optional
578
+ ProxyURL string `json:"proxyURL,omitempty"`
579
+ }
580
+
581
+ // KubeConfigUser contains information that describes identity information.
582
+ // This is used to tell the kubernetes cluster who you are.
583
+ //
584
+ // Either authProvider or exec must be filled.
585
+ //
586
+ // Adapted from clientcmdv1.AuthInfo.
587
+ type KubeConfigUser struct {
588
+ // AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
589
+ // +optional
590
+ AuthProvider * KubeConfigAuthProvider `json:"authProvider,omitempty"`
591
+
592
+ // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster.
593
+ // +optional
594
+ Exec * KubeConfigAuthExec `json:"exec,omitempty"`
595
+ }
596
+
597
+ // KubeConfigAuthProvider holds the configuration for a specified auth provider.
598
+ type KubeConfigAuthProvider struct {
599
+ // Name is the name of the authentication plugin.
600
+ Name string `json:"name"`
601
+
602
+ // Config holds the parameters for the authentication plugin.
603
+ // +optional
604
+ Config map [string ]string `json:"config,omitempty"`
605
+ }
606
+
607
+ // KubeConfigAuthExec specifies a command to provide client credentials. The command is exec'd
608
+ // and outputs structured stdout holding credentials.
609
+ //
610
+ // See the client.authentication.k8s.io API group for specifications of the exact input
611
+ // and output format.
612
+ type KubeConfigAuthExec struct {
613
+ // Command to execute.
614
+ Command string `json:"command"`
615
+
616
+ // Arguments to pass to the command when executing it.
617
+ // +optional
618
+ Args []string `json:"args,omitempty"`
619
+
620
+ // Env defines additional environment variables to expose to the process. These
621
+ // are unioned with the host's environment, as well as variables client-go uses
622
+ // to pass argument to the plugin.
623
+ // +optional
624
+ Env []KubeConfigAuthExecEnv `json:"env,omitempty"`
625
+
626
+ // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use
627
+ // the same encoding version as the input.
628
+ // Defaults to client.authentication.k8s.io/v1 if not set.
629
+ // +optional
630
+ APIVersion string `json:"apiVersion,omitempty"`
631
+
632
+ // ProvideClusterInfo determines whether or not to provide cluster information,
633
+ // which could potentially contain very large CA data, to this exec plugin as a
634
+ // part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set
635
+ // to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for
636
+ // reading this environment variable.
637
+ // +optional
638
+ ProvideClusterInfo bool `json:"provideClusterInfo,omitempty"`
639
+ }
640
+
641
+ // KubeConfigAuthExecEnv is used for setting environment variables when executing an exec-based
642
+ // credential plugin.
643
+ type KubeConfigAuthExecEnv struct {
644
+ Name string `json:"name"`
645
+ Value string `json:"value"`
515
646
}
516
647
517
648
// HostPathMount contains elements describing volumes that are mounted from the
0 commit comments