Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release-3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pixiake committed Dec 22, 2023
2 parents 3b85609 + 631e393 commit 6bb0431
Show file tree
Hide file tree
Showing 42 changed files with 952 additions and 71 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,15 @@
"contributions": [
"doc"
]
},
{
"login": "liuxu623",
"name": "刘旭",
"avatar_url": "https://avatars.githubusercontent.com/u/9653438?v=4",
"profile": "https://github.com/liuxu623",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
go-version: 1.19
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
uses: golangci/golangci-lint-action@v3.6.0
with:
version: v1.50.1
working-directory: ${{matrix.working-directory}}
2 changes: 1 addition & 1 deletion .github/workflows/kubernetes-auto-support.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'kubesphere/kubekey'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Go 1.19
uses: actions/setup-go@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Synchronize artifacts to OSS
run: |
rm -rf qsctl_v2.4.3_linux_amd64.tar.gz
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Contributions of any kind are welcome! Thanks goes to these wonderful contributo
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wenwenxiong"><img src="https://avatars.githubusercontent.com/u/10548812?v=4?s=100" width="100px;" alt="wenwenxiong"/><br /><sub><b>wenwenxiong</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=wenwenxiong" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://baimeow.cn/"><img src="https://avatars.githubusercontent.com/u/38121125?v=4?s=100" width="100px;" alt="柏喵Sakura"/><br /><sub><b>柏喵Sakura</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=BaiMeow" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://dashen.tech"><img src="https://avatars.githubusercontent.com/u/15921519?v=4?s=100" width="100px;" alt="cui fliter"/><br /><sub><b>cui fliter</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=cuishuang" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liuxu623"><img src="https://avatars.githubusercontent.com/u/9653438?v=4?s=100" width="100px;" alt="刘旭"/><br /><sub><b>刘旭</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=liuxu623" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wenwenxiong"><img src="https://avatars.githubusercontent.com/u/10548812?v=4?s=100" width="100px;" alt="wenwenxiong"/><br /><sub><b>wenwenxiong</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=wenwenxiong" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://baimeow.cn/"><img src="https://avatars.githubusercontent.com/u/38121125?v=4?s=100" width="100px;" alt="柏喵Sakura"/><br /><sub><b>柏喵Sakura</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=BaiMeow" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://dashen.tech"><img src="https://avatars.githubusercontent.com/u/15921519?v=4?s=100" width="100px;" alt="cui fliter"/><br /><sub><b>cui fliter</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=cuishuang" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liuxu623"><img src="https://avatars.githubusercontent.com/u/9653438?v=4?s=100" width="100px;" alt="刘旭"/><br /><sub><b>刘旭</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=liuxu623" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ kubectl completion bash >/etc/bash_completion.d/kubectl
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wenwenxiong"><img src="https://avatars.githubusercontent.com/u/10548812?v=4?s=100" width="100px;" alt="wenwenxiong"/><br /><sub><b>wenwenxiong</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=wenwenxiong" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://baimeow.cn/"><img src="https://avatars.githubusercontent.com/u/38121125?v=4?s=100" width="100px;" alt="柏喵Sakura"/><br /><sub><b>柏喵Sakura</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=BaiMeow" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://dashen.tech"><img src="https://avatars.githubusercontent.com/u/15921519?v=4?s=100" width="100px;" alt="cui fliter"/><br /><sub><b>cui fliter</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=cuishuang" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liuxu623"><img src="https://avatars.githubusercontent.com/u/9653438?v=4?s=100" width="100px;" alt="刘旭"/><br /><sub><b>刘旭</b></sub></a><br /><a href="https://github.com/kubesphere/kubekey/commits?author=liuxu623" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions cmd/kk/apis/kubekey/v1alpha2/addons_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Chart struct {
Version string `yaml:"version" json:"version,omitempty"`
ValuesFile string `yaml:"valuesFile" json:"valuesFile,omitempty"`
Values []string `yaml:"values" json:"values,omitempty"`
Wait bool `yaml:"wait" json:"wait,omitempty"`
}

type Yaml struct {
Expand Down
3 changes: 0 additions & 3 deletions cmd/kk/apis/kubekey/v1alpha2/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ func (cfg *ClusterSpec) GroupHosts() map[string][]*KubeHost {
if len(roleGroups[Etcd]) == 0 && cfg.Etcd.Type == KubeKey {
logger.Log.Fatal(errors.New("The number of etcd cannot be 0"))
}
if len(roleGroups[Registry]) > 1 {
logger.Log.Fatal(errors.New("The number of registry node cannot be greater than 1."))
}

for _, host := range roleGroups[ControlPlane] {
host.SetRole(Master)
Expand Down
6 changes: 3 additions & 3 deletions cmd/kk/apis/kubekey/v1alpha2/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const (
DefaultSSHTimeout = 30
DefaultEtcdVersion = "v3.5.6"
DefaultEtcdPort = "2379"
DefaultDockerVersion = "20.10.8"
DefaultContainerdVersion = "1.6.4"
DefaultRuncVersion = "v1.1.1"
DefaultDockerVersion = "24.0.6"
DefaultContainerdVersion = "1.7.8"
DefaultRuncVersion = "v1.1.10"
DefaultCrictlVersion = "v1.24.0"
DefaultKubeVersion = "v1.23.10"
DefaultCalicoVersion = "v3.26.1"
Expand Down
9 changes: 9 additions & 0 deletions cmd/kk/apis/kubekey/v1alpha2/network_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type CalicoCfg struct {
VethMTU int `yaml:"vethMTU" json:"vethMTU,omitempty"`
Ipv4NatOutgoing *bool `yaml:"ipv4NatOutgoing" json:"ipv4NatOutgoing,omitempty"`
DefaultIPPOOL *bool `yaml:"defaultIPPOOL" json:"defaultIPPOOL,omitempty"`
EnableTypha *bool `yaml:"enableTypha" json:"enableTypha,omitempty"`
}

type FlannelCfg struct {
Expand Down Expand Up @@ -183,6 +184,14 @@ func (c *CalicoCfg) EnableDefaultIPPOOL() bool {
return *c.DefaultIPPOOL
}

// Typha is used to determine whether to enable calico Typha
func (c *CalicoCfg) Typha() bool {
if c.EnableTypha == nil {
return false
}
return *c.EnableTypha
}

// EnableInit is used to determine whether to create default network
func (h *HybridnetCfg) EnableInit() bool {
if h.Init == nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/kk/pkg/addons/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func InstallChart(kubeConf *common.KubeConf, addon *kubekeyapiv1alpha2.Addon, ku
client.Keyring = defaultKeyring()
client.RepoURL = addon.Sources.Chart.Repo
client.Version = addon.Sources.Chart.Version
client.Wait = addon.Sources.Chart.Wait
//client.Force = true

if client.Version == "" && client.Devel {
Expand Down
8 changes: 6 additions & 2 deletions cmd/kk/pkg/bootstrap/registry/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ func (g *GenerateCerts) Execute(runtime connector.Runtime) error {

var altName cert.AltNames

dnsList := []string{"localhost", g.KubeConf.Cluster.Registry.PrivateRegistry, runtime.GetHostsByRole(common.Registry)[0].GetName()}
ipList := []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback, netutils.ParseIPSloppy(runtime.GetHostsByRole(common.Registry)[0].GetInternalAddress())}
dnsList := []string{"localhost", RegistryCertificateBaseName}
ipList := []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback}

for _, h := range runtime.GetHostsByRole(common.Registry) {
dnsList = append(dnsList, h.GetName())
ipList = append(ipList, netutils.ParseIPSloppy(h.GetInternalAddress()))
}
altName.DNSNames = dnsList
altName.IPs = ipList

Expand Down
16 changes: 4 additions & 12 deletions cmd/kk/pkg/bootstrap/registry/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,10 @@ func InstallHarbor(i *InstallRegistryModule) []task.Interface {
}

generateHarborConfig := &task.RemoteTask{
Name: "GenerateHarborConfig",
Desc: "Generate harbor config",
Hosts: i.Runtime.GetHostsByRole(common.Registry),
Action: &action.Template{
Template: templates.HarborConfigTempl,
Dst: "/opt/harbor/harbor.yml",
Data: util.Data{
"Domain": i.KubeConf.Cluster.Registry.PrivateRegistry,
"Certificate": fmt.Sprintf("%s.pem", i.KubeConf.Cluster.Registry.PrivateRegistry),
"Key": fmt.Sprintf("%s-key.pem", i.KubeConf.Cluster.Registry.PrivateRegistry),
},
},
Name: "GenerateHarborConfig",
Desc: "Generate harbor config",
Hosts: i.Runtime.GetHostsByRole(common.Registry),
Action: new(GenerateHarborConfig),
Parallel: true,
Retry: 1,
}
Expand Down
26 changes: 26 additions & 0 deletions cmd/kk/pkg/bootstrap/registry/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package registry

import (
"fmt"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/bootstrap/registry/templates"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/action"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util"
"path/filepath"
"strings"

Expand Down Expand Up @@ -212,6 +215,29 @@ func (g *SyncHarborPackage) Execute(runtime connector.Runtime) error {
return nil
}

type GenerateHarborConfig struct {
common.KubeAction
}

func (g *GenerateHarborConfig) Execute(runtime connector.Runtime) error {
host := runtime.RemoteHost()
templateAction := action.Template{
Template: templates.HarborConfigTempl,
Dst: "/opt/harbor/harbor.yml",
Data: util.Data{
"Domain": host.GetName(),
"Certificate": fmt.Sprintf("%s.pem", RegistryCertificateBaseName),
"Key": fmt.Sprintf("%s-key.pem", RegistryCertificateBaseName),
"Password": templates.Password(g.KubeConf, RegistryCertificateBaseName),
},
}
templateAction.Init(nil, nil)
if err := templateAction.Execute(runtime); err != nil {
return err
}
return nil
}

type StartHarbor struct {
common.KubeAction
}
Expand Down
14 changes: 14 additions & 0 deletions cmd/kk/pkg/bootstrap/registry/templates/harbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ limitations under the License.
package templates

import (
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/common"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/registry"
"strings"
"text/template"

"github.com/lithammer/dedent"
Expand Down Expand Up @@ -133,3 +136,14 @@ proxy:
`)))
)

func Password(kubeConf *common.KubeConf, domain string) string {
auths := registry.DockerRegistryAuthEntries(kubeConf.Cluster.Registry.Auths)
for repo, entry := range auths {
if strings.Contains(repo, domain) {
return entry.Password
}
}

return "Harbor12345"
}
2 changes: 1 addition & 1 deletion cmd/kk/pkg/container/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (p *DockerLoginRegistry) Execute(runtime connector.Runtime) error {
if len(entry.Username) == 0 || len(entry.Password) == 0 {
continue
}
cmd := fmt.Sprintf("docker login --username '%s' --password '%s' %s", escapeSpecialCharacters(entry.Username), escapeSpecialCharacters(entry.Password), repo)
cmd := fmt.Sprintf("HOME=$HOME docker login --username '%s' --password '%s' %s", escapeSpecialCharacters(entry.Username), escapeSpecialCharacters(entry.Password), repo)
if _, err := runtime.GetRunner().SudoCmd(cmd, false); err != nil {
return errors.Wrapf(err, "login registry failed, cmd: %v, err:%v", cmd, err)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/kk/pkg/etcd/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ func (b *BackupETCD) Execute(runtime connector.Runtime) error {
Data: util.Data{
"Hostname": runtime.RemoteHost().GetName(),
"Etcdendpoint": fmt.Sprintf("https://%s:2379", runtime.RemoteHost().GetInternalAddress()),
"DataDir": b.KubeConf.Cluster.Etcd.DataDir,
"Backupdir": b.KubeConf.Cluster.Etcd.BackupDir,
"KeepbackupNumber": b.KubeConf.Cluster.Etcd.KeepBackupNumber + 1,
"EtcdBackupScriptDir": b.KubeConf.Cluster.Etcd.BackupScriptDir,
Expand Down
4 changes: 4 additions & 0 deletions cmd/kk/pkg/etcd/templates/backup_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ set -o pipefail
ETCDCTL_PATH='/usr/local/bin/etcdctl'
ENDPOINTS='{{ .Etcdendpoint }}'
{{- if .DataDir }}
ETCD_DATA_DIR="{{ .DataDir }}"
{{- else }}
ETCD_DATA_DIR="/var/lib/etcd"
{{- end }}
BACKUP_DIR="{{ .Backupdir }}/etcd-$(date +%Y-%m-%d-%H-%M-%S)"
KEEPBACKUPNUMBER='{{ .KeepbackupNumber }}'
ETCDBACKUPSCIPT='{{ .EtcdBackupScriptDir }}'
Expand Down
6 changes: 3 additions & 3 deletions cmd/kk/pkg/files/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ func sha256sum(path string) (string, error) {
}
defer file.Close()

data, err := io.ReadAll(file)
if err != nil {
hasher := sha256.New()
if _, err := io.Copy(hasher, file); err != nil {
return "", err
}
return fmt.Sprintf("%x", sha256.Sum256(data)), nil
return fmt.Sprintf("%x", hasher.Sum(nil)), nil
}
24 changes: 12 additions & 12 deletions cmd/kk/pkg/kubernetes/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import (
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/files"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/images"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/kubernetes/templates"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/kubernetes/templates/v1beta2"
"github.com/kubesphere/kubekey/v3/cmd/kk/pkg/utils"
)

Expand Down Expand Up @@ -249,11 +248,11 @@ func (g *GenerateKubeadmConfig) Execute(runtime connector.Runtime) error {
}
}

_, ApiServerArgs := util.GetArgs(v1beta2.GetApiServerArgs(g.WithSecurityEnhancement, g.KubeConf.Cluster.Kubernetes.EnableAudit()), g.KubeConf.Cluster.Kubernetes.ApiServerArgs)
_, ControllerManagerArgs := util.GetArgs(v1beta2.GetControllermanagerArgs(g.KubeConf.Cluster.Kubernetes.Version, g.WithSecurityEnhancement), g.KubeConf.Cluster.Kubernetes.ControllerManagerArgs)
_, SchedulerArgs := util.GetArgs(v1beta2.GetSchedulerArgs(g.WithSecurityEnhancement), g.KubeConf.Cluster.Kubernetes.SchedulerArgs)
_, ApiServerArgs := util.GetArgs(templates.GetApiServerArgs(g.WithSecurityEnhancement, g.KubeConf.Cluster.Kubernetes.EnableAudit()), g.KubeConf.Cluster.Kubernetes.ApiServerArgs)
_, ControllerManagerArgs := util.GetArgs(templates.GetControllermanagerArgs(g.KubeConf.Cluster.Kubernetes.Version, g.WithSecurityEnhancement), g.KubeConf.Cluster.Kubernetes.ControllerManagerArgs)
_, SchedulerArgs := util.GetArgs(templates.GetSchedulerArgs(g.WithSecurityEnhancement), g.KubeConf.Cluster.Kubernetes.SchedulerArgs)

checkCgroupDriver, err := v1beta2.GetKubeletCgroupDriver(runtime, g.KubeConf)
checkCgroupDriver, err := templates.GetKubeletCgroupDriver(runtime, g.KubeConf)
if err != nil {
return err
}
Expand All @@ -273,8 +272,8 @@ func (g *GenerateKubeadmConfig) Execute(runtime connector.Runtime) error {
}

templateAction := action.Template{
Template: v1beta2.KubeadmConfig,
Dst: filepath.Join(common.KubeConfigDir, v1beta2.KubeadmConfig.Name()),
Template: templates.KubeadmConfig,
Dst: filepath.Join(common.KubeConfigDir, templates.KubeadmConfig.Name()),
Data: util.Data{
"IsInitCluster": g.IsInitConfiguration,
"ImageRepo": strings.TrimSuffix(images.GetImage(runtime, g.KubeConf, "kube-apiserver").ImageRepo(), "/kube-apiserver"),
Expand All @@ -296,12 +295,13 @@ func (g *GenerateKubeadmConfig) Execute(runtime connector.Runtime) error {
"ExternalEtcd": externalEtcd,
"NodeCidrMaskSize": g.KubeConf.Cluster.Kubernetes.NodeCidrMaskSize,
"CriSock": g.KubeConf.Cluster.Kubernetes.ContainerRuntimeEndpoint,
"ApiServerArgs": v1beta2.UpdateFeatureGatesConfiguration(ApiServerArgs, g.KubeConf),
"ApiServerArgs": templates.UpdateFeatureGatesConfiguration(ApiServerArgs, g.KubeConf),
"EnableAudit": g.KubeConf.Cluster.Kubernetes.EnableAudit(),
"ControllerManagerArgs": v1beta2.UpdateFeatureGatesConfiguration(ControllerManagerArgs, g.KubeConf),
"SchedulerArgs": v1beta2.UpdateFeatureGatesConfiguration(SchedulerArgs, g.KubeConf),
"KubeletConfiguration": v1beta2.GetKubeletConfiguration(runtime, g.KubeConf, g.KubeConf.Cluster.Kubernetes.ContainerRuntimeEndpoint, g.WithSecurityEnhancement),
"KubeProxyConfiguration": v1beta2.GetKubeProxyConfiguration(g.KubeConf),
"ControllerManagerArgs": templates.UpdateFeatureGatesConfiguration(ControllerManagerArgs, g.KubeConf),
"SchedulerArgs": templates.UpdateFeatureGatesConfiguration(SchedulerArgs, g.KubeConf),
"KubeletConfiguration": templates.GetKubeletConfiguration(runtime, g.KubeConf, g.KubeConf.Cluster.Kubernetes.ContainerRuntimeEndpoint, g.WithSecurityEnhancement),
"KubeProxyConfiguration": templates.GetKubeProxyConfiguration(g.KubeConf),
"IsV1beta3": versionutil.MustParseSemantic(g.KubeConf.Cluster.Kubernetes.Version).AtLeast(versionutil.MustParseSemantic("v1.22.0")),
"IsControlPlane": host.IsRole(common.Master),
"CgroupDriver": checkCgroupDriver,
"BootstrapToken": bootstrapToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package v1beta2
package templates

import (
"fmt"
Expand All @@ -38,7 +38,7 @@ var (
dedent.Dedent(`
{{- if .IsInitCluster -}}
---
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/{{ if .IsV1beta3 }}v1beta3{{ else }}v1beta2{{ end }}
kind: ClusterConfiguration
etcd:
{{- if .EtcdTypeIsKubeadm }}
Expand Down Expand Up @@ -106,7 +106,7 @@ scheduler:
{{ toYaml .SchedulerArgs | indent 4 }}
---
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/{{ if .IsV1beta3 }}v1beta3{{ else }}v1beta2{{ end }}
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: {{ .AdvertiseAddress }}
Expand All @@ -128,7 +128,7 @@ kind: KubeletConfiguration
{{- else -}}
---
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/{{ if .IsV1beta3 }}v1beta3{{ else }}v1beta2{{ end }}
kind: JoinConfiguration
discovery:
bootstrapToken:
Expand Down Expand Up @@ -159,14 +159,10 @@ var (
FeatureGatesDefaultConfiguration = map[string]bool{
"RotateKubeletServerCertificate": true, //k8s 1.7+
"TTLAfterFinished": true, //k8s 1.12+
"ExpandCSIVolumes": true, //k8s 1.14+
"CSIStorageCapacity": true, //k8s 1.19+
}
FeatureGatesSecurityDefaultConfiguration = map[string]bool{
"RotateKubeletServerCertificate": true, //k8s 1.7+
"TTLAfterFinished": true, //k8s 1.12+
"ExpandCSIVolumes": true, //k8s 1.14+
"CSIStorageCapacity": true, //k8s 1.19+
"SeccompDefault": true, //kubelet
}

Expand Down
1 change: 1 addition & 0 deletions cmd/kk/pkg/loadbalancer/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (g *GetInterfaceName) Execute(runtime connector.Runtime) error {
}
cmd := fmt.Sprintf("ip route "+
"| grep ' %s ' "+
"| grep 'proto kernel scope link src'"+
"| sed -e \"s/^.*dev.//\" -e \"s/.proto.*//\""+
"| uniq ", host.GetAddress())
interfaceName, err := runtime.GetRunner().SudoCmd(cmd, false)
Expand Down
Loading

0 comments on commit 6bb0431

Please sign in to comment.