Skip to content

Commit

Permalink
Merge pull request #805 from 24sama/v2.0.0
Browse files Browse the repository at this point in the history
support kubesphere v3.2.1
  • Loading branch information
ks-ci-bot committed Nov 29, 2021
2 parents e0a4faf + 491aa5e commit 81e38d6
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 72 deletions.
7 changes: 4 additions & 3 deletions cmd/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/kubesphere/kubekey/cmd/ctl/util"
"github.com/kubesphere/kubekey/pkg/common"
"github.com/kubesphere/kubekey/pkg/pipelines"
"github.com/kubesphere/kubekey/pkg/version/kubernetes"
"github.com/kubesphere/kubekey/pkg/version/kubesphere"
"github.com/kubesphere/kubekey/version"
"github.com/spf13/cobra"
"time"
)
Expand Down Expand Up @@ -111,13 +111,14 @@ func (o *CreateClusterOptions) AddFlags(cmd *cobra.Command) {
func completionSetting(cmd *cobra.Command) (err error) {
cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) (
strings []string, directive cobra.ShellCompDirective) {
versionArray := []string{"v2.1.1", "v3.0.0", "v3.1.0", "v3.1.1", "v3.2.0", time.Now().Add(-time.Hour * 24).Format("nightly-20060102")}
versionArray := kubesphere.VersionsStringArr()
versionArray = append(versionArray, time.Now().Add(-time.Hour*24).Format("nightly-20060102"))
return versionArray, cobra.ShellCompDirectiveNoFileComp
}

err = cmd.RegisterFlagCompletionFunc("with-kubernetes", func(cmd *cobra.Command, args []string, toComplete string) (
strings []string, directive cobra.ShellCompDirective) {
return version.SupportedK8sVersionList(), cobra.ShellCompDirectiveNoFileComp
return kubernetes.SupportedK8sVersionList(), cobra.ShellCompDirectiveNoFileComp
})
return
}
7 changes: 4 additions & 3 deletions cmd/ctl/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/kubesphere/kubekey/cmd/ctl/util"
"github.com/kubesphere/kubekey/pkg/common"
"github.com/kubesphere/kubekey/pkg/pipelines"
"github.com/kubesphere/kubekey/pkg/version/kubernetes"
"github.com/kubesphere/kubekey/pkg/version/kubesphere"
"github.com/kubesphere/kubekey/version"
"github.com/spf13/cobra"
"time"
)
Expand Down Expand Up @@ -99,13 +99,14 @@ func (o *UpgradeOptions) AddFlags(cmd *cobra.Command) {
func completionSetting(cmd *cobra.Command) (err error) {
cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) (
strings []string, directive cobra.ShellCompDirective) {
versionArray := []string{"v2.1.1", "v3.0.0", "v3.1.0", "v3.1.1", "v3.2.0", time.Now().Add(-time.Hour * 24).Format("nightly-20060102")}
versionArray := kubesphere.VersionsStringArr()
versionArray = append(versionArray, time.Now().Add(-time.Hour*24).Format("nightly-20060102"))
return versionArray, cobra.ShellCompDirectiveNoFileComp
}

err = cmd.RegisterFlagCompletionFunc("with-kubernetes", func(cmd *cobra.Command, args []string, toComplete string) (
strings []string, directive cobra.ShellCompDirective) {
return version.SupportedK8sVersionList(), cobra.ShellCompDirectiveNoFileComp
return kubernetes.SupportedK8sVersionList(), cobra.ShellCompDirectiveNoFileComp
})
return
}
3 changes: 2 additions & 1 deletion cmd/ctl/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package version

import (
"fmt"
"github.com/kubesphere/kubekey/pkg/version/kubernetes"
"github.com/kubesphere/kubekey/version"
"github.com/spf13/cobra"
"io"
Expand Down Expand Up @@ -71,6 +72,6 @@ func printVersion(short bool) error {
}

func printSupportedK8sVersionList(output io.Writer) (err error) {
_, err = output.Write([]byte(fmt.Sprintln(strings.Join(version.SupportedK8sVersionList(), "\n"))))
_, err = output.Write([]byte(fmt.Sprintln(strings.Join(kubernetes.SupportedK8sVersionList(), "\n"))))
return
}
31 changes: 31 additions & 0 deletions pkg/version/kubernetes/version_enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,34 @@ func VersionSupport(version string) bool {
}
return false
}

// SupportedK8sVersionList returns the supported list of Kubernetes
func SupportedK8sVersionList() []string {
return []string{
"v1.15.12",
"v1.16.8",
"v1.16.10",
"v1.16.12",
"v1.16.13",
"v1.17.0",
"v1.17.4",
"v1.17.5",
"v1.17.6",
"v1.17.7",
"v1.17.8",
"v1.17.9",
"v1.18.3",
"v1.18.5",
"v1.18.6",
"v1.18.8",
"v1.19.0",
"v1.19.8",
"v1.19.9",
"v1.20.4",
"v1.20.6",
"v1.20.10",
"v1.21.4",
"v1.21.5",
"v1.22.1",
}
}
17 changes: 17 additions & 0 deletions pkg/version/kubesphere/ks_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,20 @@ var KsV320 = &KsInstaller{
V311.String(),
},
}

var KsV321 = &KsInstaller{
Version: V321.String(),
CRDTemplate: templates.KsInstaller,
ClusterConfigurationTemplate: templates.V321,
K8sSupportVersions: []string{
"v1.19",
"v1.20",
"v1.21",
"v1.22",
},
UpgradeSupportVersions: []string{
V310.String(),
V311.String(),
V320.String(),
},
}
198 changes: 198 additions & 0 deletions pkg/version/kubesphere/templates/cc_v321.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
/*
Copyright 2021 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package templates

import (
"github.com/lithammer/dedent"
"text/template"
)

var V321 = template.Must(template.New("v3.2.1").Parse(
dedent.Dedent(`
---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
name: ks-installer
namespace: kubesphere-system
labels:
version: {{ .Tag }}
spec:
persistence:
storageClass: ""
authentication:
jwtSecret: ""
local_registry: ""
# dev_tag: ""
etcd:
monitoring: false
endpointIps: localhost
port: 2379
tlsEnable: true
common:
core:
console:
enableMultiLogin: true
port: 30880
type: NodePort
# apiserver:
# resources: {}
# controllerManager:
# resources: {}
redis:
enabled: false
volumeSize: 2Gi
openldap:
enabled: false
volumeSize: 2Gi
minio:
volumeSize: 20Gi
monitoring:
# type: external
endpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090
GPUMonitoring:
enabled: false
gpu:
kinds:
- resourceName: "nvidia.com/gpu"
resourceType: "GPU"
default: true
es:
# master:
# volumeSize: 4Gi
# replicas: 1
# resources: {}
# data:
# volumeSize: 20Gi
# replicas: 1
# resources: {}
logMaxAge: 7
elkPrefix: logstash
basicAuth:
enabled: false
username: ""
password: ""
externalElasticsearchHost: ""
externalElasticsearchPort: ""
alerting:
enabled: false
# thanosruler:
# replicas: 1
# resources: {}
auditing:
enabled: false
# operator:
# resources: {}
# webhook:
# resources: {}
devops:
enabled: false
jenkinsMemoryLim: 2Gi
jenkinsMemoryReq: 1500Mi
jenkinsVolumeSize: 8Gi
jenkinsJavaOpts_Xms: 512m
jenkinsJavaOpts_Xmx: 512m
jenkinsJavaOpts_MaxRAM: 2g
events:
enabled: false
# operator:
# resources: {}
# exporter:
# resources: {}
# ruler:
# enabled: true
# replicas: 2
# resources: {}
logging:
enabled: false
containerruntime: docker
logsidecar:
enabled: true
replicas: 2
# resources: {}
metrics_server:
enabled: false
monitoring:
storageClass: ""
# kube_rbac_proxy:
# resources: {}
# kube_state_metrics:
# resources: {}
# prometheus:
# replicas: 1
# volumeSize: 20Gi
# resources: {}
# operator:
# resources: {}
# adapter:
# resources: {}
# node_exporter:
# resources: {}
# alertmanager:
# replicas: 1
# resources: {}
# notification_manager:
# resources: {}
# operator:
# resources: {}
# proxy:
# resources: {}
gpu:
nvidia_dcgm_exporter:
enabled: false
# resources: {}
multicluster:
clusterRole: none
network:
networkpolicy:
enabled: false
ippool:
type: none
topology:
type: none
openpitrix:
store:
enabled: false
servicemesh:
enabled: false
kubeedge:
enabled: false
cloudCore:
nodeSelector: {"node-role.kubernetes.io/worker": ""}
tolerations: []
cloudhubPort: "10000"
cloudhubQuicPort: "10001"
cloudhubHttpsPort: "10002"
cloudstreamPort: "10003"
tunnelPort: "10004"
cloudHub:
advertiseAddress:
- ""
nodeLimit: "100"
service:
cloudhubNodePort: "30000"
cloudhubQuicNodePort: "30001"
cloudhubHttpsNodePort: "30002"
cloudstreamNodePort: "30003"
tunnelNodePort: "30004"
edgeWatcher:
nodeSelector: {"node-role.kubernetes.io/worker": ""}
tolerations: []
edgeWatcherAgent:
nodeSelector: {"node-role.kubernetes.io/worker": ""}
tolerations: []
`)))

0 comments on commit 81e38d6

Please sign in to comment.