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

Support Alicloud #283

Closed
wants to merge 20 commits into from
Closed
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
506 changes: 506 additions & 0 deletions acre-aliyun-example.yaml

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 @@ -118,6 +118,13 @@ landscape:
chart_path: charts/gardener-extension-provider-openstack
image_tag: (( valid( provider-openstack.tag ) ? provider-openstack.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: (( ~~ ))
networking-calico:
<<: (( merge ))
tag: (( valid( networking-calico.branch ) -or valid( networking-calico.commit ) ? ~~ :.dependency_versions.versions.gardener.extensions.networking-calico.version ))
Expand Down Expand Up @@ -230,13 +237,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 @@ -277,6 +286,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"]]
networks:
- ["mapfield", "internal", ["cidr"]]
- ["mapfield", "public", ["cidr"]]
- ["mapfield", "vpc", ["or", ["mapfield", "id"], ["mapfield", "cidr", ["cidr"]]]]
azure:
credentials:
- and
Expand Down Expand Up @@ -367,6 +388,9 @@ validation:
swift:
credentials: (( iaas.openstack.credentials ))
config: (( return_true ))
oss:
credentials: (( iaas.alicloud.credentials ))
config: (( return_true ))
dns:
google-clouddns:
credentials: (( iaas.gcp.credentials ))
Expand All @@ -382,6 +406,9 @@ validation:
- <<: (( iaas.openstack.credentials ))
- ["mapfield", "region"]
config: (( return_true ))
alicloud-dns:
credentials: (( iaas.alicloud.credentials ))
config: (( return_true ))
cloudflare-dns:
credentials:
- mapfield
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 @@ -61,6 +61,7 @@ typeToProvider:
azure-dns: azure
openstack-designate: openstack
cloudflare-dns: cloudflare
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 ))
41 changes: 41 additions & 0 deletions components/etcd/backupinfra/provider/oss/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// 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" {
access_key = var.ACCESS_KEY
secret_key = var.SECRET_KEY
region = var.REGION
version = "=1.95.0"
}

resource "random_id" "storage_account" {
byte_length = 8
}

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

resource "alicloud_oss_bucket" "bucket-acl" {
bucket = "${var.BUCKETNAME}${random_id.storage_account.hex}"
acl = "private"
}

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

output "bucketName" {
value = "${var.BUCKETNAME}${random_id.storage_account.hex}"
}
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 OSS 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"
}
2 changes: 1 addition & 1 deletion components/etcd/backupinfra/provider/s3/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable "SECRET_KEY" {
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ spec:
- "ReadWriteOnce"
resources:
requests:
storage: 10Gi
storage: 20Gi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will affect other existing landscapes. Can you make it configurable?

1 change: 1 addition & 0 deletions 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
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