Documentation ¶
Index ¶
- Constants
- Variables
- func Base64Decode(str string) ([]byte, error)
- func Base64Encode(bytes []byte) string
- func ContainsString(slice []string, s string) bool
- func CreateAdminKubeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
- func CreateBasic(serverURL, clusterName, userName string, caCert []byte) *clientcmdapi.Config
- func CreateControllerManagerKUbeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
- func CreateKubeconfigWithCerts(serverURL, clusterName, userName string, caCert []byte, clientKey []byte, ...) *clientcmdapi.Config
- func CreateSchedulerKubeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
- func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error)
- func ExecCmd(shell string, cmdStr string) (string, error)
- func Exists(path string) bool
- func GenerateCaCert(cfg Config) (*x509.Certificate, *rsa.PrivateKey, error)
- func GenerateCert(cfg Config, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey, error)
- func GenerateServiceAccountKey() (*rsa.PrivateKey, error)
- func GetCrdClient(kubeconfig []byte) (*crdclient.Clientset, error)
- func GetRuntimeClient(kubeconfig []byte) (runtimeclient.Client, error)
- func IgnoreAlreadyExist(err error) error
- func IgnoreNotFound(err error) error
- func InitMatrixClient(mcClient runtimeclient.Client, ctx context.Context, matrixName string, ...) error
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func NewSelfSignedCACert(cfg Config, key *rsa.PrivateKey) (*x509.Certificate, error)
- func NewServiceAccountSigningKey() (*rsa.PrivateKey, error)
- func NewSignedCert(cfg Config, key *rsa.PrivateKey, caCert *x509.Certificate, ...) (*x509.Certificate, error)
- func ParseTemplate(strtmpl string, obj ...interface{}) ([]byte, error)
- func RemoveString(slice []string, s string) (result []string)
- func Telnet(host string, port string) bool
- func WriteFile(fileName string, b []byte) error
- type AltNames
- type Config
Constants ¶
View Source
const ( ECPrivateKeyBlockType = "EC PRIVATE KEY" RSAPrivateKeyBlockType = "RSA PRIVATE KEY" PrivateKeyBlockType = "PRIVATE KEY" CertificateBlockType = "CERTIFICATE" CertificateRequestBlockType = "CERTIFICATE REQUEST" AdminKubeConfigFileName = "admin.conf" ControllerManagerKubeConfigFileName = "controller-manager.conf" SchedulerKubeConfigFileName = "scheduler.conf" DefaultServerUrl = "https://127.0.0.1:6443" )
Variables ¶
View Source
var MatrixClient = make(map[string]runtimeclient.Client)
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func ContainsString ¶
func CreateAdminKubeconfig ¶
func CreateAdminKubeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
func CreateBasic ¶
func CreateBasic(serverURL, clusterName, userName string, caCert []byte) *clientcmdapi.Config
func CreateControllerManagerKUbeconfig ¶
func CreateControllerManagerKUbeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
func CreateSchedulerKubeconfig ¶
func CreateSchedulerKubeconfig(caCert *x509.Certificate, caKey *rsa.PrivateKey, serverUrl string) ([]byte, error)
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
func EncodePrivateKeyPEM ¶
func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
func GenerateCaCert ¶
func GenerateCaCert(cfg Config) (*x509.Certificate, *rsa.PrivateKey, error)
func GenerateCert ¶
func GenerateCert(cfg Config, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey, error)
func GenerateServiceAccountKey ¶
func GenerateServiceAccountKey() (*rsa.PrivateKey, error)
func GetRuntimeClient ¶
func GetRuntimeClient(kubeconfig []byte) (runtimeclient.Client, error)
func IgnoreAlreadyExist ¶
func IgnoreNotFound ¶
func InitMatrixClient ¶
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
func NewSelfSignedCACert ¶
func NewSelfSignedCACert(cfg Config, key *rsa.PrivateKey) (*x509.Certificate, error)
NewSelfSignedCACert creates a CA certificate
func NewServiceAccountSigningKey ¶
func NewServiceAccountSigningKey() (*rsa.PrivateKey, error)
func NewSignedCert ¶
func NewSignedCert(cfg Config, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)
NewSignedCert creates a signed certificate using the given CA certificate and key
func ParseTemplate ¶
func RemoveString ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.