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

Enable alicloud #771

Merged
merged 28 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aa9b0b4
test base-3.19
kevin-lacoo Apr 22, 2022
e13cc74
add gardener-extension-provider-alicloud to dependency-versions
kevin-lacoo Apr 22, 2022
f7ecadc
add provider-alicloud to acre.yaml
kevin-lacoo Apr 22, 2022
320555d
add validation for iaas alicloud
kevin-lacoo Apr 22, 2022
639034c
add provider-alicloud to gardener/extensions/deployment.yaml
kevin-lacoo Apr 22, 2022
cff2aee
add alicloud cloud profile config
kevin-lacoo Apr 22, 2022
5d7ce76
update alicloud profile
kevin-lacoo Apr 25, 2022
20c75e8
add gardenlinux 318.8.0
kevin-lacoo Apr 25, 2022
81a60d6
add alicloud to seeds
kevin-lacoo Apr 25, 2022
7fa89cb
update acre for alicloud
kevin-lacoo Apr 25, 2022
a869c4e
update shoot yaml for alicloud
kevin-lacoo Apr 25, 2022
7d80a0a
update alicloud provider to 1.34
kevin-lacoo Apr 25, 2022
81c2129
set alicloud provider 1.31
kevin-lacoo Apr 25, 2022
c2bb9fa
use alicloud provider 1.34
kevin-lacoo Apr 25, 2022
793a4c1
update alicloud default shoot network
kevin-lacoo Apr 26, 2022
8a47c43
add blockcidrs for alicloud
kevin-lacoo Apr 28, 2022
ec3d5c7
update readme
kevin-lacoo Apr 28, 2022
36ef89d
enable alicloud oss for etcd backup
kevin-lacoo Apr 28, 2022
5e14956
typos
kevin-lacoo Apr 28, 2022
b5e2f7f
update etcd cluster
kevin-lacoo Apr 29, 2022
b240042
update etcd.event values
kevin-lacoo Apr 29, 2022
89f2e8e
update shootdefault network
kevin-lacoo Apr 29, 2022
12e47ad
update alicloud oss tf
kevin-lacoo Apr 29, 2022
ecfa8df
enable alicloud dns
kevin-lacoo May 4, 2022
a33be5b
update readme for alicloud
kevin-lacoo May 5, 2022
37bf343
change typos
kevin-lacoo May 5, 2022
6d5b626
update alicloud iaas.yaml
kevin-lacoo May 5, 2022
3fb744b
update alicloud extensions
kevin-lacoo May 6, 2022
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
31 changes: 17 additions & 14 deletions README.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions acre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ landscape:
chart_path: charts/gardener-extension-provider-aws
image_tag: (( valid( provider-aws.tag ) ? provider-aws.tag :~~ ))
image_repo: (( ~~ ))
provider-alicloud:
<<: (( merge ))
tag: (( valid( provider-alicloud.branch ) -or valid( provider-alicloud.commit ) ? ~~ :.dependency_versions.versions.gardener.extensions.provider-alicloud.version ))
repo: (( .dependency_versions.versions.gardener.extensions.provider-alicloud.repo ))
chart_path: charts/gardener-extension-provider-alicloud
image_tag: (( valid( provider-alicloud.tag ) ? provider-alicloud.tag :~~ ))
image_repo: (( ~~ ))
provider-gcp:
<<: (( merge ))
tag: (( valid( provider-gcp.branch ) -or valid( provider-gcp.commit ) ? ~~ :.dependency_versions.versions.gardener.extensions.provider-gcp.version ))
Expand Down Expand Up @@ -277,13 +284,15 @@ dns_type_mapping:
aws: aws-route53
azure: azure-dns
openstack: openstack-designate
alicloud: alicloud-dns

backup_type_mapping:
<<: (( &temporary ))
gcp: gcs
aws: s3
azure: abs
openstack: swift
alicloud: oss


######################
Expand Down Expand Up @@ -331,6 +340,18 @@ validation:
- ["mapfield", "internal", ["cidr"]]
- ["mapfield", "public", ["cidr"]]
- ["mapfield", "vpc", ["or", ["mapfield", "id"], ["mapfield", "cidr", ["cidr"]]]]
alicloud:
credentials:
- and
- ["mapfield", "accessKeyID"]
- ["mapfield", "accessKeySecret"]
config:
- ["mapfield", "region"]
- ["mapfield", "zones", ["list"]]
profileConfig:
- (( return_true ))
networks:
- ["mapfield", "vpc", ["or", ["mapfield", "id"], ["mapfield", "cidr", ["cidr"]]]]
azure:
credentials:
- and
Expand Down Expand Up @@ -493,6 +514,9 @@ validation:
swift:
credentials: (( iaas.openstack.credentials ))
config: (( return_true ))
oss:
credentials: (( iaas.alicloud.credentials ))
config: (( return_true ))
backup_config:
- <<: (( &template ))
- and
Expand All @@ -516,6 +540,9 @@ validation:
azure-dns:
credentials: (( iaas.azure.credentials ))
config: (( return_true ))
alicloud-dns:
credentials: (( iaas.alicloud.credentials ))
config: (( return_true ))
openstack-designate:
credentials:
- <<: (( iaas.openstack.credentials ))
Expand Down
1 change: 1 addition & 0 deletions components/dns-controller/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typeToProvider:
openstack-designate: openstack
cloudflare-dns: cloudflare
infoblox-dns: infoblox
alicloud-dns: alicloud

spec:
<<: (( &temporary ))
Expand Down
1 change: 1 addition & 0 deletions components/etcd/backupinfra/provider/oss/export.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bucketname: (( data.terraform.outputs.bucketName.value ))
46 changes: 46 additions & 0 deletions components/etcd/backupinfra/provider/oss/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
//
// 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.

provider "alicloud" {
version = "~> 1.162.0"
access_key = var.ACCESS_KEY
secret_key = var.SECRET_KEY
region = var.REGION
}

//=====================================================================
//= OSS bucket
//=====================================================================

resource "alicloud_oss_bucket" "bucket" {
bucket = var.BUCKETNAME
acl = "private"
force_destroy = true
server_side_encryption_rule {
sse_algorithm = "KMS"
}
tags = {
Name = var.LANDSCAPE
}
}

//=====================================================================
//= Output variables
//=====================================================================

output "bucketName" {
value = alicloud_oss_bucket.bucket.id
}


17 changes: 17 additions & 0 deletions components/etcd/backupinfra/provider/oss/tfvars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
#
# 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.

ACCESS_KEY: (( config.credentials.accessKeyID ))
SECRET_KEY: (( config.credentials.accessKeySecret ))
LANDSCAPE: (( landscape.name ))
39 changes: 39 additions & 0 deletions components/etcd/backupinfra/provider/oss/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
//
# 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.

variable "ACCESS_KEY" {
description = "ALICLOUD Access Key"
type = string
}

variable "SECRET_KEY" {
description = "ALICLOUD Secret Key"
type = string
}

variable "REGION" {
description = "Region of the ALICLOUD bucket"
type = string
}

variable "BUCKETNAME" {
description = "Name of the bucket"
type = string
}

variable "LANDSCAPE" {
description = "Name of the Landscape (for tagging)"
type = string
}

4 changes: 4 additions & 0 deletions components/etcd/backupinfra/provider/oss/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ spec:
- "ReadWriteOnce"
resources:
requests:
storage: 10Gi
storage: {{ .Values.volumeClaimTemplates.requests.storage }}
4 changes: 4 additions & 0 deletions components/etcd/cluster/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ resources:
cpu: 1000m
memory: 2560Mi

volumeClaimTemplates:
requests:
storage: 10Gi

# Aws S3 storage configuration
# Note: No volumeMounts variable needed
# storageProvider: "S3"
Expand Down
9 changes: 8 additions & 1 deletion components/etcd/cluster/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
s3: S3
abs: ABS
swift: Swift
oss: OSS

server:
commonName: garden:etcd-server:etcd
Expand Down Expand Up @@ -91,7 +92,7 @@ etcd:
backup:
schedule: (( defined(landscape.etcd.backup.schedule) ? landscape.etcd.backup.schedule :"0 */24 * * *" )) # Backup interval (default 24h)
maxBackups: (( defined(landscape.etcd.backup.maxBackups) ? landscape.etcd.backup.maxBackups :7 )) # Maximum number of backups to keep (default 7)
storageProvider: (( landscape.etcd.backup.active ? spec.providertypes.[landscape.etcd.backup.type] :"" )) # Abs,Gcs,S3,Swift empty means no backup,
storageProvider: (( landscape.etcd.backup.active ? spec.providertypes.[landscape.etcd.backup.type] :"" )) # Abs,Gcs,S3,Swift,OSS empty means no backup,
secretData: (( sum[temp.config.credentials|{}|c,k,v|->c {k=base64(v)}] ))
storageContainer: (( landscape.etcd.backup.active ? imports.backupinfra.export.bucketname :~ ))
env: (( temp.addon.env ))
Expand All @@ -110,6 +111,9 @@ etcd:

resources:
<<: (( landscape.etcd.resources || ~~ ))
volumeClaimTemplates:
requests:
storage: (( landscape.iaas.[0].type == "alicloud" ? "20Gi" :"10Gi" ))
events:
kubeconfig: (( landscape.clusters.[0].kubeconfig ))
files:
Expand All @@ -135,4 +139,7 @@ etcd:
client:
crt: (( state.client.value.cert ))
key: (( state.client.value.key ))
volumeClaimTemplates:
requests:
storage: (( landscape.iaas.[0].type == "alicloud" ? "20Gi" :"10Gi" ))

23 changes: 23 additions & 0 deletions components/etcd/cluster/provider/oss/provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
#
# 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.

env:
- name: "ALICLOUD_ENDPOINT"
value: (( "oss-" config.region "-internal.aliyuncs.com" ))
- name: "ALICLOUD_ACCESS_KEY_ID"
value: (( config.credentials.accessKeyID ))
- name: "ALICLOUD_ACCESS_KEY_SECRET"
value: (( config.credentials.accessKeySecret ))

volumeMounts: []
Loading