1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-22 20:08:53 +00:00
Files
rke/pki/kubeconfig.go
galal-hussein ad34392a3c Add default cluster config file and return service container pointer
Add more generic functions to go services

Add x509 authentication
2017-11-06 19:40:15 +02:00

24 lines
551 B
Go

package pki
func getKubeConfigX509(kubernetesURL string, componentName string, caPath string, crtPath string, keyPath string) string {
return `apiVersion: v1
kind: Config
clusters:
- cluster:
api-version: v1
certificate-authority: ` + caPath + `
server: "` + kubernetesURL + `"
name: "local"
contexts:
- context:
cluster: "local"
user: "` + componentName + `"
name: "Default"
current-context: "Default"
users:
- name: "` + componentName + `"
user:
client-certificate: ` + crtPath + `
client-key: ` + keyPath + ``
}