mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-03 12:36:09 -04:00
Capitalize Kubernetes
This commit is contained in:
parent
0518e6ff0a
commit
482f675dac
9 changed files with 18 additions and 18 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
|
||||
const fieldManager = "constellation-coordinator"
|
||||
|
||||
// Client implements k8sapi.Client interface and talks to the kubernetes API.
|
||||
// Client implements k8sapi.Client interface and talks to the Kubernetes API.
|
||||
type Client struct {
|
||||
clientset kubernetes.Interface
|
||||
builder *resource.Builder
|
||||
|
|
|
@ -24,7 +24,7 @@ type clientGenerator interface {
|
|||
NewClient(kubeconfig []byte) (Client, error)
|
||||
}
|
||||
|
||||
// Kubectl implements kubernetes.Apply interface and acts like the kubernetes "kubectl" tool.
|
||||
// Kubectl implements kubernetes.Apply interface and acts like the Kubernetes "kubectl" tool.
|
||||
type Kubectl struct {
|
||||
clientGenerator
|
||||
kubeconfig []byte
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
|
||||
)
|
||||
|
||||
// kubeConfig is the path to the kubernetes admin config (used for authentication).
|
||||
// kubeConfig is the path to the Kubernetes admin config (used for authentication).
|
||||
const kubeConfig = "/etc/kubernetes/admin.conf"
|
||||
|
||||
// Client provides the functionality of `kubectl apply`.
|
||||
|
@ -141,7 +141,7 @@ func (k *KubernetesUtil) SetupCloudNodeManager(kubectl Client, cloudNodeManagerC
|
|||
return kubectl.Apply(cloudNodeManagerConfiguration, true)
|
||||
}
|
||||
|
||||
// JoinCluster joins existing kubernetes cluster using kubeadm join.
|
||||
// JoinCluster joins existing Kubernetes cluster using kubeadm join.
|
||||
func (k *KubernetesUtil) JoinCluster(joinConfig []byte) error {
|
||||
joinConfigFile, err := os.CreateTemp("", "kubeadm-join.*.yaml")
|
||||
if err != nil {
|
||||
|
@ -153,7 +153,7 @@ func (k *KubernetesUtil) JoinCluster(joinConfig []byte) error {
|
|||
return fmt.Errorf("writing kubeadm init yaml config %v failed: %w", joinConfigFile.Name(), err)
|
||||
}
|
||||
|
||||
// run `kubeadm join` to join a worker node to an existing kubernetes cluster
|
||||
// run `kubeadm join` to join a worker node to an existing Kubernetes cluster
|
||||
cmd := exec.Command("kubeadm", "join", "--config", joinConfigFile.Name())
|
||||
if _, err := cmd.Output(); err != nil {
|
||||
var exitErr *exec.ExitError
|
||||
|
|
|
@ -46,7 +46,7 @@ func New(clusterUtil k8sapi.ClusterUtil, configProvider configurationProvider, c
|
|||
}
|
||||
}
|
||||
|
||||
// InitCluster initializes a new kubernetes cluster and applies pod network provider.
|
||||
// InitCluster initializes a new Kubernetes cluster and applies pod network provider.
|
||||
func (k *KubeWrapper) InitCluster(in InitClusterInput) (*kubeadm.BootstrapTokenDiscovery, error) {
|
||||
initConfig := k.configProvider.InitConfiguration()
|
||||
initConfig.SetApiServerAdvertiseAddress(in.APIServerAdvertiseIP)
|
||||
|
@ -103,7 +103,7 @@ func (k *KubeWrapper) InitCluster(in InitClusterInput) (*kubeadm.BootstrapTokenD
|
|||
return joinK8SClusterRequest, nil
|
||||
}
|
||||
|
||||
// JoinCluster joins existing kubernetes cluster.
|
||||
// JoinCluster joins existing Kubernetes cluster.
|
||||
func (k *KubeWrapper) JoinCluster(args *kubeadm.BootstrapTokenDiscovery, nodeName, nodeInternalIP, nodeVPNIP, providerID, certKey string, peerRole role.Role) error {
|
||||
joinConfig := k.configProvider.JoinConfiguration()
|
||||
joinConfig.SetApiServerEndpoint(args.APIServerEndpoint)
|
||||
|
@ -153,7 +153,7 @@ func NewFakeK8SClient([]byte) (k8sapi.Client, error) {
|
|||
return &fakeK8SClient{}, nil
|
||||
}
|
||||
|
||||
// Apply fakes applying kubernetes resources.
|
||||
// Apply fakes applying Kubernetes resources.
|
||||
func (f *fakeK8SClient) Apply(resources resources.Marshaler, forceConflicts bool) error {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue