Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kubeadm default config #2314

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
echo "${{steps.drafter.outputs.body}}" >> release_note.md

- name: Save release notes
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: sealer-release-notes
path: src/github.com/sealerio/sealer/release_note.md
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
working-directory: src/github.com/sealerio/sealer

- name: Save build binaries
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: sealer-binaries
path: src/github.com/sealerio/sealer/_output/assets/*.tar.gz*
Expand All @@ -108,7 +108,7 @@ jobs:

steps:
- name: Download builds and release notes
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: builds
- name: Create Release
Expand All @@ -131,4 +131,4 @@ jobs:
releasever="${releasever#refs/tags/}"
wget http://gosspublic.alicdn.com/ossutil/1.6.19/ossutil64 && chmod 755 ossutil64 &&
./ossutil64 -i ${{ secrets.ACCESSKEYID }} -k ${{ secrets.ACCESSKEYSECRET }} -e oss-cn-shanghai.aliyuncs.com cp -rf ./builds/sealer-binaries/sealer-$releasever-linux-amd64.tar.gz oss://sealerio/releases/sealer-$releasever-linux-amd64.tar.gz &&
./ossutil64 -i ${{ secrets.ACCESSKEYID }} -k ${{ secrets.ACCESSKEYSECRET }} -e oss-cn-shanghai.aliyuncs.com cp -rf ./builds/sealer-binaries/sealer-$releasever-linux-arm64.tar.gz oss://sealerio/releases/sealer-$releasever-linux-arm64.tar.gz
./ossutil64 -i ${{ secrets.ACCESSKEYID }} -k ${{ secrets.ACCESSKEYSECRET }} -e oss-cn-shanghai.aliyuncs.com cp -rf ./builds/sealer-binaries/sealer-$releasever-linux-arm64.tar.gz oss://sealerio/releases/sealer-$releasever-linux-arm64.tar.gz
2 changes: 1 addition & 1 deletion cmd/sealer/cmd/alpha/host-alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewHostAliasCmd() *cobra.Command {

cf.SetCluster(desiredCluster)

return cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true})
return cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false})
},
}
cmd.Flags().StringVar(&hostAlias.IP, "ip", "", "host-alias ip")
Expand Down
8 changes: 4 additions & 4 deletions cmd/sealer/cmd/cluster/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (i AppInstaller) Install(imageName string, options AppInstallOptions) error
//save and commit
i.cf.SetApplication(i.appDriver.GetApplication())
confPath := clusterruntime.GetClusterConfPath(i.imageExtension.Labels)
if err := i.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err := i.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down Expand Up @@ -350,7 +350,7 @@ func (k KubeInstaller) Install(kubeImageName string, options KubeInstallOptions)

//save and commit
confPath := clusterruntime.GetClusterConfPath(k.imageSpec.ImageExtension.Labels)
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down Expand Up @@ -436,7 +436,7 @@ func (k KubeInstaller) ScaleUp(scaleUpMasterIPList, scaleUpNodeIPList []net.IP,
}

confPath := clusterruntime.GetClusterConfPath(k.imageSpec.ImageExtension.Labels)
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down Expand Up @@ -519,7 +519,7 @@ func (k KubeInstaller) ScaleDown(deleteMasterIPList, deleteNodeIPList []net.IP,
k.cf.SetCluster(cluster)

confPath := clusterruntime.GetClusterConfPath(k.imageSpec.ImageExtension.Labels)
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err = k.cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/sealer/cmd/cluster/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func rollbackCluster(cf clusterfile.Interface, imageEngine imageengine.Interface
}

//save and commit
if err = cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err = cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/sealer/cmd/cluster/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ import (

var (
exampleForUpgradeCmd = `
sealer upgrade docker.io/sealerio/kubernetes:v1.22.15-upgrade
sealer upgrade -f Clusterfile
sealer upgrade -f upgrade.yaml
`
longDescriptionForUpgradeCmd = `upgrade command is used to upgrade a Kubernetes cluster via specified Clusterfile.`
)
Expand Down Expand Up @@ -209,7 +208,7 @@ func upgradeCluster(cf clusterfile.Interface, imageEngine imageengine.Interface,
}

//save and commit
if err = cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: true, ConfPath: confPath}); err != nil {
if err = cf.SaveAll(clusterfile.SaveOptions{CommitToCluster: false, ConfPath: confPath}); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
KubeLvsCareStaticPodName = "kube-lvscare"
RegLvsCareStaticPodName = "reg-lvscare"
StaticPodDir = "/etc/kubernetes/manifests"
LvsCareRepoAndTag = "sealerio/lvscare:v1.1.3-beta.8"
LvsCareRepoAndTag = "docker-cdv5ju.swr-pro.myhuaweicloud.com/global/lvscare:latest"
)

// Envs
Expand Down
5 changes: 3 additions & 2 deletions pkg/registry/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (c *localConfigurator) configureLvs(registryHosts, clientHosts []net.IP) er
}

//todo should make lvs image name as const value in sealer repo.
lvsImageURL := path.Join(net.JoinHostPort(c.Domain, strconv.Itoa(c.Port)), common.LvsCareRepoAndTag)
lvsImageURL := path.Join(common.LvsCareRepoAndTag)

vip := GetRegistryVIP(c.infraDriver)

Expand Down Expand Up @@ -399,7 +399,7 @@ func (c *localConfigurator) configureContainerdDaemonService(endpoint, hostTomlF
cfg := Hosts{
Server: url,
HostConfigs: map[string]HostFileConfig{
url: {CACert: registryCaCertPath},
url: {CACert: registryCaCertPath, SkipServerVerify: true},
},
}

Expand All @@ -425,6 +425,7 @@ type HostFileConfig struct {
// - string - Single file with certificate(s)
// - []string - Multiple files with certificates
CACert interface{} `toml:"ca"`
SkipServerVerify bool `toml:"skip_verify"`
}

type DaemonConfig struct {
Expand Down
6 changes: 1 addition & 5 deletions pkg/runtime/kubernetes/kubeadm/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ networking:
serviceSubnet: 10.96.0.0/22
apiServer:
extraArgs:
feature-gates: TTLAfterFinished=true,EphemeralContainers=true
audit-policy-file: "/etc/kubernetes/audit-policy.yml"
audit-log-path: "/var/log/kubernetes/audit.log"
audit-log-format: json
Expand All @@ -65,17 +64,14 @@ apiServer:
pathType: File
controllerManager:
extraArgs:
feature-gates: TTLAfterFinished=true,EphemeralContainers=true
experimental-cluster-signing-duration: 876000h
cluster-signing-duration: 876000h
extraVolumes:
- hostPath: /etc/localtime
mountPath: /etc/localtime
name: localtime
readOnly: true
pathType: File
scheduler:
extraArgs:
feature-gates: TTLAfterFinished=true,EphemeralContainers=true
extraVolumes:
- hostPath: /etc/localtime
mountPath: /etc/localtime
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/kubernetes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func GetClientFromConfig(adminConfPath string) (runtimeClient.Client, error) {
}

func (k *Runtime) configureLvs(masterHosts, clientHosts []net.IP) error {
lvsImageURL := path.Join(k.Config.RegistryInfo.URL, common.LvsCareRepoAndTag)
lvsImageURL := path.Join(common.LvsCareRepoAndTag)

var rs []string
var realEndpoints []string
Expand Down
Loading