diff --git a/build/docker/tools/tke-installer/dockerd-entrypoint.sh b/build/docker/tools/tke-installer/dockerd-entrypoint.sh index 4749a863ff..39c82fde66 100755 --- a/build/docker/tools/tke-installer/dockerd-entrypoint.sh +++ b/build/docker/tools/tke-installer/dockerd-entrypoint.sh @@ -139,6 +139,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then --tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \ --tlscert "$DOCKER_TLS_CERTDIR/server/cert.pem" \ --tlskey "$DOCKER_TLS_CERTDIR/server/key.pem" \ + --insecure-registry=registry.tke.com \ "$@" DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2376:2376/tcp" else @@ -146,6 +147,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then set -- dockerd \ --host="$dockerSocket" \ --host=tcp://0.0.0.0:2375 \ + --insecure-registry=registry.tke.com \ "$@" DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp" fi diff --git a/cmd/tke-installer/app/installer/expansion.go b/cmd/tke-installer/app/installer/expansion.go index 197074ea7c..d0ca4d7305 100644 --- a/cmd/tke-installer/app/installer/expansion.go +++ b/cmd/tke-installer/app/installer/expansion.go @@ -130,34 +130,34 @@ func (t *TKE) expansionRendAndCopy(from, to string, perm os.FileMode, needRend b } // importExpansionCharts uploads expansion charts -func (t *TKE) importExpansionCharts(ctx context.Context) error { - chartPath := path.Join(t.Config.CustomExpansionDir, t.Config.CustomChartsName) - if info, err := os.Stat(chartPath); err != nil { - if os.IsNotExist(err) { - // no chart file found means no charts. - return nil - } - return fmt.Errorf("locate chart file get system error %v,%v", chartPath, err) - } else if info.IsDir() { - return fmt.Errorf("chart file is a directory %v", chartPath) - } - - // TODO: (workaround ) client init will only be called in createCluster. - // If we SKIP createCluster step, all client call will be panic - if t.registryClient == nil { - err := t.initDataForDeployTKE() - if err != nil { - return err - } - } - - err := t.pushCharts(ctx, chartPath, constants.DefaultTeantID, constants.DefaultExpansionChartGroupName) - if err != nil { - return err - } - return nil - -} +// func (t *TKE) importExpansionCharts(ctx context.Context) error { +// chartPath := path.Join(t.Config.CustomExpansionDir, t.Config.CustomChartsName) +// if info, err := os.Stat(chartPath); err != nil { +// if os.IsNotExist(err) { +// // no chart file found means no charts. +// return nil +// } +// return fmt.Errorf("locate chart file get system error %v,%v", chartPath, err) +// } else if info.IsDir() { +// return fmt.Errorf("chart file is a directory %v", chartPath) +// } + +// // TODO: (workaround ) client init will only be called in createCluster. +// // If we SKIP createCluster step, all client call will be panic +// if t.registryClient == nil { +// err := t.initDataForDeployTKE() +// if err != nil { +// return err +// } +// } + +// err := t.pushCharts(ctx, chartPath, constants.DefaultTeantID, constants.DefaultExpansionChartGroupName) +// if err != nil { +// return err +// } +// return nil + +// } func copyFile(src, dst string, perm os.FileMode) error { diff --git a/cmd/tke-installer/app/installer/installer.go b/cmd/tke-installer/app/installer/installer.go index a3169dd67d..e679ed97a9 100644 --- a/cmd/tke-installer/app/installer/installer.go +++ b/cmd/tke-installer/app/installer/installer.go @@ -460,19 +460,19 @@ func (t *TKE) initSteps() { }, }...) - if t.Para.Config.Registry.ThirdPartyRegistry == nil && - t.Para.Config.Registry.TKERegistry != nil { - t.steps = append(t.steps, []types.Handler{ - { - Name: "Import charts", - Func: t.importCharts, - }, - { - Name: "Import Expansion Charts", - Func: t.importExpansionCharts, - }, - }...) - } + // if t.Para.Config.Registry.ThirdPartyRegistry == nil && + // t.Para.Config.Registry.TKERegistry != nil { + // t.steps = append(t.steps, []types.Handler{ + // { + // Name: "Import charts", + // Func: t.importCharts, + // }, + // { + // Name: "Import Expansion Charts", + // Func: t.importExpansionCharts, + // }, + // }...) + // } if len(t.Para.Config.ExpansionApps) > 0 { t.steps = append(t.steps, []types.Handler{ @@ -1922,7 +1922,7 @@ func (t *TKE) installInfluxDBChart(ctx context.Context) error { LocalChartPath: constants.ChartDirName + "influxdb/", Enable: true, ConditionFunc: func() (bool, error) { - ok, err := apiclient.CheckStatefulSet(ctx, t.globalClient, t.namespace, "influxdb") + ok, err := apiclient.CheckDeployment(ctx, t.globalClient, t.namespace, "influxdb") if err != nil || !ok { return false, nil } diff --git a/cmd/tke-installer/app/installer/manifests/charts/influxdb/templates/influxdb.yaml b/cmd/tke-installer/app/installer/manifests/charts/influxdb/templates/influxdb.yaml index 2290aca811..6a14b10f8d 100644 --- a/cmd/tke-installer/app/installer/manifests/charts/influxdb/templates/influxdb.yaml +++ b/cmd/tke-installer/app/installer/manifests/charts/influxdb/templates/influxdb.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: influxdb namespace: tke @@ -7,10 +7,11 @@ metadata: app: influxdb spec: replicas: 1 - serviceName: influxdb selector: matchLabels: app: influxdb + strategy: + type: Recreate template: metadata: labels: diff --git a/cmd/tke-installer/app/installer/manifests/charts/tke-registry/templates/tke-registry-api.yaml b/cmd/tke-installer/app/installer/manifests/charts/tke-registry/templates/tke-registry-api.yaml index ea903fb4fa..5495318403 100644 --- a/cmd/tke-installer/app/installer/manifests/charts/tke-registry/templates/tke-registry-api.yaml +++ b/cmd/tke-installer/app/installer/manifests/charts/tke-registry/templates/tke-registry-api.yaml @@ -27,6 +27,8 @@ spec: selector: matchLabels: app: tke-registry-api + strategy: + type: Recreate template: metadata: labels: diff --git a/cmd/tke-installer/app/installer/manifests/tke-gateway/tke-gateway.yaml b/cmd/tke-installer/app/installer/manifests/tke-gateway/tke-gateway.yaml index 84c6cf030e..578b7f637f 100644 --- a/cmd/tke-installer/app/installer/manifests/tke-gateway/tke-gateway.yaml +++ b/cmd/tke-installer/app/installer/manifests/tke-gateway/tke-gateway.yaml @@ -13,12 +13,14 @@ spec: app: tke-gateway ports: - name: http - protocol: TCP + nodePort: 31180 port: 80 + protocol: TCP targetPort: 80 - name: https - protocol: TCP + nodePort: 31443 port: 443 + protocol: TCP targetPort: 443 --- apiVersion: apps/v1 @@ -36,7 +38,6 @@ spec: app: tke-gateway spec: dnsPolicy: ClusterFirstWithHostNet - hostNetwork: true nodeSelector: node-role.kubernetes.io/master: "" containers: diff --git a/pkg/logagent/registry/logagent/storage/fileproxy.go b/pkg/logagent/registry/logagent/storage/fileproxy.go index 5967a8fced..2652703496 100644 --- a/pkg/logagent/registry/logagent/storage/fileproxy.go +++ b/pkg/logagent/registry/logagent/storage/fileproxy.go @@ -3,12 +3,13 @@ package storage import ( "context" "fmt" - "k8s.io/apimachinery/pkg/api/errors" "net/http" "net/http/httputil" "net/url" "time" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" netutil "k8s.io/apimachinery/pkg/util/net" @@ -51,7 +52,7 @@ func (r *LogfileProxyREST) Connect(ctx context.Context, clusterName string, opts return nil, errors.NewInternalError(fmt.Errorf("unable to get host ip with config %+v", *proxyOpts)) } return &logFileProxyHandler{ - location: &url.URL{Scheme: "http", Host: hostIP + ":8090"}, + location: &url.URL{Scheme: "http", Host: hostIP + ":" + util.LogagentPort}, namespace: proxyOpts.Namespace, pod: proxyOpts.Pod, container: proxyOpts.Container, diff --git a/pkg/logagent/util/logagent.go b/pkg/logagent/util/logagent.go index 0b64ee472b..4f3e535bee 100644 --- a/pkg/logagent/util/logagent.go +++ b/pkg/logagent/util/logagent.go @@ -23,7 +23,7 @@ import ( ) const ( - LogagentPort = "8090" + LogagentPort = "31139" ) type ReaderCloserGetter interface {