Skip to content

Commit

Permalink
Merge branch 'master' into feat/backup-incremental-size
Browse files Browse the repository at this point in the history
  • Loading branch information
WangLe1321 committed Jul 28, 2023
2 parents 4d7d04a + 87b2874 commit 3ab633d
Show file tree
Hide file tree
Showing 126 changed files with 1,908 additions and 102,772 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
- name: Run chaos mesh
uses: chaos-mesh/chaos-mesh-actions@master
env:
CFG_BASE64: YXBpVmVyc2lvbjogY2hhb3MtbWVzaC5vcmcvdjFhbHBoYTEKa2luZDogUG9kQ2hhb3MKbWV0YWRhdGE6CiAgbmFtZTogcG9kLWZhaWx1cmUKICBuYW1lc3BhY2U6IHBpbmdjYXAKc3BlYzoKICBhY3Rpb246IHBvZC1mYWlsdXJlIAogIG1vZGU6IG9uZSAKICBkdXJhdGlvbjogIjYwcyIKICBzZWxlY3RvcjoKICAgIGxhYmVsU2VsZWN0b3JzOgogICAgICAiYXBwLmt1YmVybmV0ZXMuaW8vY29tcG9uZW50IjogImNvbnRyb2xsZXItbWFuYWdlciIKICBzY2hlZHVsZXI6CiAgICBjcm9uOiAiQGV2ZXJ5IDVtIgo=
CHAOS_MESH_VERSION: v1.0.0
CFG_BASE64: YXBpVmVyc2lvbjogY2hhb3MtbWVzaC5vcmcvdjFhbHBoYTEKa2luZDogU2NoZWR1bGUKbWV0YWRhdGE6CiAgbmFtZTogcG9kLWZhaWx1cmUKICBuYW1lc3BhY2U6IHBpbmdjYXAKc3BlYzoKICBzY2hlZHVsZTogJ0BldmVyeSA1bScKICB0eXBlOiBQb2RDaGFvcwogIGhpc3RvcnlMaW1pdDogNQogIGNvbmN1cnJlbmN5UG9saWN5OiBGb3JiaWQKICBwb2RDaGFvczoKICAgIGFjdGlvbjogcG9kLWZhaWx1cmUKICAgIG1vZGU6IG9uZQogICAgZHVyYXRpb246IDYwcwogICAgc2VsZWN0b3I6CiAgICAgIGxhYmVsU2VsZWN0b3JzOgogICAgICAgIGFwcC5rdWJlcm5ldGVzLmlvL2NvbXBvbmVudDogY29udHJvbGxlci1tYW5hZ2VyCg==
CHAOS_MESH_VERSION: v2.1.0
- name: Run e2e
run: |
SKIP_UP=y ./hack/e2e.sh -- --ginkgo.focus='Restarter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ spec:
{{- if .Values.brFederationManager.kubeClientBurst }}
- -kube-client-burst={{ .Values.brFederationManager.kubeClientBurst }}
{{- end }}
{{- if .Values.brFederationManager.federationKubeconfigSecretKey }}
- -federation-kubeconfig-path=/etc/br-federation/federation-kubeconfig/{{ .Values.brFederationManager.federationKubeconfigSecretKey }}
{{- end }}
env:
- name: NAMESPACE
valueFrom:
Expand Down
5 changes: 4 additions & 1 deletion charts/br-federation/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ brFederationManager:
serviceAccount: br-federation-manager

# Secret name of the kubeconfig for the federation Kubernetes clusters
# The data item key is the cluster name, and the data item value is the base64 encoded kubeconfig
federationKubeconfigSecret: br-federation-kubeconfig
# which data item is the kubeconfig file, and the data item value is the base64 encoded kubeconfig
# if you have multiple kubernetes clusters, you should merge them in one kubeconfig
# we use the context name in the kubeconfig as the k8sClusterName in volume backup/restore CR
federationKubeconfigSecretKey: kubeconfig

logLevel: 2
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ webhooks:
objectSelector:
matchLabels:
"app.kubernetes.io/managed-by": "tidb-operator"
admissionReviewVersions: ["v1beta1"]
admissionReviewVersions: ["v1"]
failurePolicy: {{ .Values.admissionWebhook.failurePolicy.validation | default "Fail" }}
sideEffects: None
clientConfig:
Expand Down Expand Up @@ -79,7 +79,7 @@ metadata:
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
webhooks:
- name: validating.admission.tidb.pingcap.com
admissionReviewVersions: ["v1beta1"]
admissionReviewVersions: ["v1"]
failurePolicy: {{ .Values.admissionWebhook.failurePolicy.validation | default "Fail" }}
sideEffects: None
clientConfig:
Expand Down Expand Up @@ -113,7 +113,7 @@ metadata:
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
webhooks:
- name: defaulting.admission.tidb.pingcap.com
admissionReviewVersions: ["v1beta1"]
admissionReviewVersions: ["v1"]
failurePolicy: {{ .Values.admissionWebhook.failurePolicy.mutation | default "Fail" }}
sideEffects: None
clientConfig:
Expand Down
3 changes: 1 addition & 2 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ scheduler:
# AdvancedStatefulSet controller.
# Note that AdvancedStatefulSet CRD must be installed manually via the following
# command:
# kubectl apply -f manifests/advanced-statefulset-crd.v1beta1.yaml # k8s version < 1.16.0
# kubectl apply -f manifests/advanced-statefulset-crd.v1.yaml # k8s version >= 1.16.0
# kubectl apply -f manifests/advanced-statefulset-crd.v1.yaml
advancedStatefulset:
create: false
image: pingcap/advanced-statefulset:v0.4.0
Expand Down
4 changes: 2 additions & 2 deletions ci/pull_e2e_kind.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ e2ePodResources = [
storage: "250Gi"
],
limits: [
cpu: "16",
memory: "32Gi",
cpu: "24",
memory: "48Gi",
storage: "250Gi"
],
]
Expand Down
7 changes: 4 additions & 3 deletions cmd/backup-manager/app/clean/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ func (bo *Options) deleteSnapshotsAndBackupMeta(ctx context.Context, backup *v1a
}()

contents, err := os.ReadFile(metaFile)

if errors.Is(err, os.ErrNotExist) {
klog.Warningf("read metadata file %s failed, err: %s, a mannual check or delete aciton require.", metaFile, err)
return nil
klog.Errorf("read metadata file %s failed, err: %s, a manual check or delete action required.", metaFile, err)
return err
} else if err != nil { // will retry it
klog.Warningf("read metadata file %s failed, err: %s", metaFile, err)
klog.Errorf("read metadata file %s failed, err: %s", metaFile, err)
return err
}

Expand Down
15 changes: 6 additions & 9 deletions cmd/br-federation-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
_ "net/http/pprof"
"os"
"os/signal"
"path/filepath"
"reflect"
"syscall"

Expand Down Expand Up @@ -219,18 +218,16 @@ func main() {
}

func initFederationKubeClients(cliCfg *controller.BrFedCLIConfig) (map[string]fedversioned.Interface, error) {
files, err := os.ReadDir(cliCfg.FederationKubeConfigPath)
kubeConfig, err := clientcmd.LoadFromFile(cliCfg.FederationKubeConfigPath)
if err != nil {
return nil, err
}

clients := make(map[string]fedversioned.Interface)
for _, f := range files {
if f.IsDir() || f.Name() == "..data" {
continue
}

cfg, err := clientcmd.BuildConfigFromFlags("", filepath.Join(cliCfg.FederationKubeConfigPath, f.Name()))
for contextName := range kubeConfig.Contexts {
cfg, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
&clientcmd.ClientConfigLoadingRules{ExplicitPath: cliCfg.FederationKubeConfigPath},
&clientcmd.ConfigOverrides{CurrentContext: contextName}).ClientConfig()
if err != nil {
return nil, err // return error if any kube client init failed
}
Expand All @@ -243,7 +240,7 @@ func initFederationKubeClients(cliCfg *controller.BrFedCLIConfig) (map[string]fe
if err != nil {
return nil, err
}
clients[f.Name()] = cli
clients[contextName] = cli
}

return clients, nil
Expand Down
38 changes: 0 additions & 38 deletions cmd/to-crdgen/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5642,7 +5642,7 @@ string
<td>
<code>AdditionalPrinterColums</code></br>
<em>
[]k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1.CustomResourceColumnDefinition
[]k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceColumnDefinition
</em>
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/tidb-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ spec:
## ImagePullPolicy of grafana.
# imagePullPolicy: IfNotPresent
## Grafana version.
version: v7.5.11
version: 7.5.11
## Describes the compute resource requirements and limits of grafana.
## Ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
# requests:
Expand Down
3 changes: 0 additions & 3 deletions examples/heterogeneous-tls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ The following steps will create a basic TLS TiDB cluster , then we can create a

## Install Cert Manager
Reference [document](https://cert-manager.io/docs/installation/).
```bash
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.yaml
```

## Install TLS certificate
The following commands is assumed to be executed in this directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-cluster-client-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB"
usages:
- client auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-pd-cluster-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB"
usages:
- server auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-tidb-client-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB Client"
usages:
- client auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-tidb-cluster-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB"
usages:
- server auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-tidb-server-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB Server"
usages:
- server auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ spec:
secretName: ns1-tikv-cluster-secret
duration: 8760h # 365d
renewBefore: 360h # 15d
organization:
- PingCAP
subject:
organizations:
- PingCAP
commonName: "TiDB"
usages:
- server auth
Expand Down
2 changes: 1 addition & 1 deletion examples/selfsigned-tls/selfsigned-ca.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: selfsigned-ca-cert
Expand Down
2 changes: 1 addition & 1 deletion examples/selfsigned-tls/selfsigned-cert-issuer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-cert-issuer
Expand Down
2 changes: 1 addition & 1 deletion examples/selfsigned-tls/selfsigned-issuer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
Expand Down
6 changes: 3 additions & 3 deletions examples/selfsigned-tls/tidb-client-cert.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: tidb-client-cert
Expand All @@ -7,8 +7,8 @@ spec:
subject:
organizationalUnits:
- "TiDB Operator"
organization:
- "PingCAP"
organizations:
- PingCAP
duration: "8760h" # 364 days
# If you want verify server cert Common Name (e.g. --ssl-verify-server-cert
# flag in MySQL CLI), you must configure the HostName you used to connect the
Expand Down
6 changes: 3 additions & 3 deletions examples/selfsigned-tls/tidb-server-cert.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cert-manager.io/v1alpha2
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: tidb-server-cert
Expand All @@ -7,8 +7,8 @@ spec:
subject:
organizationalUnits:
- "TiDB Operator"
organization:
- "PingCAP"
organizations:
- PingCAP
duration: "8760h" # 364 days
# If you want verify server cert Common Name (e.g. --ssl-verify-server-cert
# flag in MySQL CLI), you must configure the HostName you used to connect the
Expand Down
Loading

0 comments on commit 3ab633d

Please sign in to comment.