Skip to content

Commit

Permalink
Merge remote-tracking branch 'tkestack/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pavleli committed Dec 23, 2020
2 parents e17e2f2 + be4e509 commit d23ab3b
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 28 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ For the full story, head over to the [developer's documentation](docs/devel/deve

* You are encouraged to communicate most things via GitHub [issues](https://github.com/tkestack/tke/issues/new/choose) or [pull requests](https://github.com/tkestack/tke/pulls).

* Other active channels:

* WeChat Group

* Please scan the following WeChat QRcode and note "**TKEStack**", he will add you into the TKEStack WeChat Group.

![TKEStack](docs/images/wechat.jpeg)

## Licensing

TKEStack is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.
Expand Down
5 changes: 0 additions & 5 deletions docs/guide/zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ make

如果有使用问题、发现bug、有新的需求,我们都非常欢迎您通过的 GitHub [issues](https://github.com/tkestack/tke/issues/new/choose) or [pull requests](https://github.com/tkestack/tke/pulls) 进行交流。

TKEStack 微信群:

- 请扫描下方的二维码并备注: “**TKEStack**

![TKEStack](../../images/wechat.jpeg)

## Licensing

Expand Down
6 changes: 1 addition & 5 deletions docs/guide/zh-CN/installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@ TKEStack 的安装需要一个小时左右,具体时间也依赖使用的硬

2. 如有更多安装类问题,例如安装失败了如何重新部署等,请参考 [部署类问题](../FAQ/installation)

3. 可以提出一个 [Issue](https://github.com/tkestack/tke/issues/new/choose),我们会认真对待每一个 Issue

4. 如果需要更多帮助,欢迎加入 TKEStack 社区,请扫描下方二维码,并备注“**TKEStack**

![](../../../images/wechat.jpeg)
3. 可以提出一个 [Issue](https://github.com/tkestack/tke/issues/new/choose),我们会认真对待每一个 Issue
4 changes: 1 addition & 3 deletions docs/guide/zh-CN/installation/installation-procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,4 @@ TKEStack 的安装需要一个小时左右,具体时间也依赖使用的硬

1. 请首先检查 [部署环境要求](../installation/installation-requirement.md)
2. 如有更多安装类问题,例如安装失败了如何重新部署等,请参考 [部署类问题](../FAQ/Installation)
3. 可以提出一个 [Issue](https://github.com/tkestack/tke/issues/new/choose),我们会认真对待每一个 Issue
4. 如果需要更多帮助,欢迎加入 TKEStack 社区,请扫描下方二维码,并备注“TKESTack”
![](../../../images/wechat.jpeg)
3. 可以提出一个 [Issue](https://github.com/tkestack/tke/issues/new/choose),我们会认真对待每一个 Issue
Binary file removed docs/images/wechat.jpeg
Binary file not shown.
7 changes: 6 additions & 1 deletion pkg/auth/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"net/http"
"net/http/httputil"
"strings"
"tkestack.io/tke/pkg/platform/registry/cluster"
"unicode"

"github.com/go-openapi/inflect"
Expand All @@ -42,6 +41,7 @@ import (
"tkestack.io/tke/api/registry"
commonapiserverfilter "tkestack.io/tke/pkg/apiserver/filter"
"tkestack.io/tke/pkg/platform/apiserver/filter"
"tkestack.io/tke/pkg/platform/registry/cluster"
"tkestack.io/tke/pkg/util/log"
)

Expand All @@ -50,6 +50,7 @@ const (

createProjectAction string = "createProject"
updateProjectAction string = "updateProject"
createClusterAction string = "createCluster"

// Annotation key names set in advanced audit
decisionAnnotationKey = "authorization.auth.tke.com/decision"
Expand All @@ -61,6 +62,10 @@ const (
reasonError = "internal error"
)

var (
AllowClusterNotFoundActions = sets.NewString(createClusterAction, updateProjectAction)
)

func ExtractClusterNames(ctx context.Context, req *http.Request, resource string) []string {
clusterNames := sets.NewString()

Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/filter/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func CheckClustersTenant(ctx context.Context, tenantID string, clusterNames []st
for _, clusterName := range clusterNames {
cluster, err := platformClient.Clusters().Get(ctx, clusterName, metav1.GetOptions{})
if err != nil {
if verb == updateProjectAction && k8serrors.IsNotFound(err) {
if AllowClusterNotFoundActions.Has(verb) && k8serrors.IsNotFound(err) {
continue
}
return fmt.Sprintf("check cluster: %+v err: %+v", clusterName, err), false
Expand Down
4 changes: 2 additions & 2 deletions pkg/monitor/controller/prometheus/yamls.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func scrapeConfigForPrometheus() string {
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: keep
regex: "tke-(.*)"
regex: "tke-(.*)|gpu-manager-(.*)"
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod_name
Expand All @@ -191,7 +191,7 @@ func scrapeConfigForPrometheus() string {
replacement: $1:$2
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: 'tke_(.*)|process_(.*)|grpc_(.*)|go_(.*)|apiserver_(.*)|etcd_(.*)'
regex: 'tke_(.*)|process_(.*)|grpc_(.*)|go_(.*)|apiserver_(.*)|etcd_(.*)|container_gpu_utilization|container_request_gpu_utilization|container_gpu_memory_total|container_request_gpu_memory'
action: keep
- source_labels: [label_tkestack_io_projectName]
action: replace
Expand Down
4 changes: 2 additions & 2 deletions pkg/platform/controller/addon/prometheus/yamls.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func scrapeConfigForPrometheus() string {
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: keep
regex: "tke-(.*)"
regex: "tke-(.*)|gpu-manager-(.*)"
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod_name
Expand All @@ -191,7 +191,7 @@ func scrapeConfigForPrometheus() string {
replacement: $1:$2
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: 'tke_(.*)|process_(.*)|grpc_(.*)|go_(.*)|apiserver_(.*)|etcd_(.*)'
regex: 'tke_(.*)|process_(.*)|grpc_(.*)|go_(.*)|apiserver_(.*)|etcd_(.*)|container_gpu_utilization|container_request_gpu_utilization|container_gpu_memory_total|container_request_gpu_memory'
action: keep
- source_labels: [label_tkestack_io_projectName]
action: replace
Expand Down
8 changes: 8 additions & 0 deletions pkg/platform/provider/baremetal/cluster/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ func (p *Provider) getKubeProxyConfiguration(c *v1.Cluster) *kubeproxyv1alpha1.K
if c.Spec.Features.IPVS != nil && *c.Spec.Features.IPVS {
config.Mode = "ipvs"
config.ClusterCIDR = c.Spec.ClusterCIDR
if c.Spec.Features.HA != nil {
if c.Spec.Features.HA.TKEHA != nil {
config.IPVS.ExcludeCIDRs = []string{fmt.Sprintf("%s/32", c.Spec.Features.HA.TKEHA.VIP)}
}
if c.Spec.Features.HA.ThirdPartyHA != nil {
config.IPVS.ExcludeCIDRs = []string{fmt.Sprintf("%s/32", c.Spec.Features.HA.ThirdPartyHA.VIP)}
}
}
}
if utilsnet.IsIPv6CIDRString(c.Spec.ClusterCIDR) {
config.BindAddress = "::"
Expand Down
3 changes: 3 additions & 0 deletions pkg/platform/registry/cluster/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ func (s *FinalizeStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.
}

func CorrectClusterName(clusterName string) string {
if clusterName == "global" {
return clusterName
}
if !strings.HasPrefix(clusterName, NamePrefix) {
return ""
}
Expand Down
9 changes: 8 additions & 1 deletion pkg/util/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ func New(c *Config) (*SSH, error) {

authMethods := make([]ssh.AuthMethod, 0)
if c.Password != "" {
authMethods = append(authMethods, ssh.Password(c.Password))
authMethods = append(authMethods,
ssh.Password(c.Password),
ssh.KeyboardInteractive(func(user, instruction string, questions []string, echos []bool) (answers []string, err error) {
if len(questions) == 1 {
return []string{c.Password}, nil
}
return nil, nil
}))
}
if len(c.PrivateKey) != 0 {
signer, err := MakePrivateKeySigner(c.PrivateKey, c.PassPhrase)
Expand Down

0 comments on commit d23ab3b

Please sign in to comment.