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

Backup: make tikv support add serviceaccount and switch rclone env_auth to true #1930

Merged
merged 2 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/api-references/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -10703,6 +10703,17 @@ <h3 id="pingcap.com/v1alpha1.TiKVSpec">TiKVSpec
</tr>
<tr>
<td>
<code>serviceAccount</code></br>
<em>
string
</em>
</td>
<td>
<p>Specify a Service Account for tikv</p>
</td>
</tr>
<tr>
<td>
<code>replicas</code></br>
<em>
int32
Expand Down
2 changes: 1 addition & 1 deletion images/tidb-backup-manager/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "Create rclone.conf file."
cat <<EOF > /tmp/rclone.conf
[s3]
type = s3
env_auth = false
env_auth = true
shuijing198799 marked this conversation as resolved.
Show resolved Hide resolved
provider = ${S3_PROVIDER}
access_key_id = ${AWS_ACCESS_KEY_ID}
secret_access_key = ${AWS_SECRET_ACCESS_KEY:-$AWS_SECRET_KEY}
Expand Down
3 changes: 3 additions & 0 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5996,6 +5996,9 @@ spec:
description: 'SchedulerName of the component. Override the cluster-level
one if present Optional: Defaults to cluster-level setting'
type: string
serviceAccount:
description: Specify a Service Account for tikv
type: string
storageClassName:
description: The storageClassName of the persistent volume for TiKV
data storage. Defaults to Kubernetes default storage class.
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/pingcap/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/pingcap/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ type TiKVSpec struct {
ComponentSpec `json:",inline"`
corev1.ResourceRequirements `json:",inline"`

// Specify a Service Account for tikv
ServiceAccount string `json:"serviceAccount,omitempty"`

// The desired ready replicas
// +kubebuilder:validation:Minimum=1
Replicas int32 `json:"replicas"`
Expand Down
1 change: 1 addition & 0 deletions pkg/manager/member/tikv_member_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func getNewTiKVSetForTidbCluster(tc *v1alpha1.TidbCluster, cm *corev1.ConfigMap)
podSpec.SecurityContext = podSecurityContext
podSpec.InitContainers = initContainers
podSpec.Containers = []corev1.Container{tikvContainer}
podSpec.ServiceAccountName = tc.Spec.TiKV.ServiceAccount
shuijing198799 marked this conversation as resolved.
Show resolved Hide resolved

tikvset := &apps.StatefulSet{
ObjectMeta: metav1.ObjectMeta{
Expand Down