mirror of
https://github.com/outbackdingo/kamaji.git
synced 2026-01-27 02:19:22 +00:00
* feat(api): customising cluster domain option Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * feat(helm): customising cluster domain option Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> * docs: customising cluster domain option Signed-off-by: Dario Tranchitella <dario@tranchitella.eu> --------- Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
76 lines
2.0 KiB
Go
76 lines
2.0 KiB
Go
// Copyright 2022 Clastix Labs
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package kubeadm
|
|
|
|
import (
|
|
json "github.com/json-iterator/go"
|
|
clientcmdapiv1 "k8s.io/client-go/tools/clientcmd/api/v1"
|
|
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
|
|
|
"github.com/clastix/kamaji/internal/utilities"
|
|
)
|
|
|
|
type Configuration struct {
|
|
InitConfiguration kubeadmapi.InitConfiguration
|
|
Kubeconfig clientcmdapiv1.Config
|
|
Parameters Parameters
|
|
}
|
|
|
|
func (c *Configuration) Checksum() string {
|
|
initConfiguration, _ := utilities.EncodeToYaml(&c.InitConfiguration)
|
|
kubeconfig, _ := json.Marshal(c.Kubeconfig)
|
|
parameters, _ := json.Marshal(c.Parameters)
|
|
|
|
data := map[string][]byte{
|
|
"InitConfiguration": initConfiguration,
|
|
"Kubeconfig": kubeconfig,
|
|
"Parameters": parameters,
|
|
}
|
|
|
|
return utilities.CalculateMapChecksum(data)
|
|
}
|
|
|
|
type Parameters struct {
|
|
TenantControlPlaneName string
|
|
TenantControlPlaneNamespace string
|
|
TenantControlPlaneEndpoint string
|
|
TenantControlPlaneAddress string
|
|
TenantControlPlaneCertSANs []string
|
|
TenantControlPlanePort int32
|
|
TenantControlPlaneClusterDomain string
|
|
TenantControlPlanePodCIDR string
|
|
TenantControlPlaneServiceCIDR string
|
|
TenantDNSServiceIPs []string
|
|
TenantControlPlaneVersion string
|
|
TenantControlPlaneCGroupDriver string
|
|
ETCDs []string
|
|
CertificatesDir string
|
|
KubeconfigDir string
|
|
KubeProxyOptions *AddonOptions
|
|
CoreDNSOptions *AddonOptions
|
|
}
|
|
|
|
type AddonOptions struct {
|
|
Repository string
|
|
Tag string
|
|
}
|
|
|
|
type KubeletConfiguration struct {
|
|
TenantControlPlaneDomain string
|
|
TenantControlPlaneDNSServiceIPs []string
|
|
TenantControlPlaneCgroupDriver string
|
|
}
|
|
|
|
type CertificatePrivateKeyPair struct {
|
|
Name string
|
|
Certificate []byte
|
|
PrivateKey []byte
|
|
}
|
|
|
|
type PublicKeyPrivateKeyPair struct {
|
|
Name string
|
|
PublicKey []byte
|
|
PrivateKey []byte
|
|
}
|