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

Deprecate kyma provision gardener #1060

Merged
merged 11 commits into from
May 27, 2024
2 changes: 0 additions & 2 deletions tests/integration/scripts/custom-domain-gardener-aws-gh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ export SCALER_MAX=3
export SCALER_MIN=1
export GARDENER_PROVIDER="aws"
export GARDENER_REGION="eu-west-1"
export GARDENER_ZONES="eu-west-1b,eu-west-1c,eu-west-1a"
export GARDENER_PROVIDER_SECRET_NAME="aws-gardener-access"
export GARDENER_PROJECT_NAME="goatz"
export GARDENER_CLUSTER_VERSION="1.27.8"
export GARDENER_GARDENLINUX_VERSION="1312.3.0"

./tests/integration/scripts/custom-domain-gardener-gh.sh
2 changes: 0 additions & 2 deletions tests/integration/scripts/custom-domain-gardener-gcp-gh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ export SCALER_MAX=3
export SCALER_MIN=1
export GARDENER_PROVIDER="gcp"
export GARDENER_REGION="europe-west3"
export GARDENER_ZONES="europe-west3-c,europe-west3-b,europe-west3-a"
export GARDENER_PROVIDER_SECRET_NAME="goat"
export GARDENER_PROJECT_NAME="goatz"
export GARDENER_CLUSTER_VERSION="1.27.8"
export GARDENER_GARDENLINUX_VERSION="1312.3.0"

./tests/integration/scripts/custom-domain-gardener-gh.sh
42 changes: 18 additions & 24 deletions tests/integration/scripts/provision-gardener-gh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ requiredVars=(
CLUSTER_NAME
GARDENER_PROVIDER
GARDENER_REGION
GARDENER_ZONES
GARDENER_KUBECONFIG
GARDENER_PROJECT_NAME
GARDENER_PROVIDER_SECRET_NAME
Expand All @@ -36,26 +35,21 @@ requiredVars=(

check_required_vars "${requiredVars[@]}"

# Install Kyma CLI in latest version
echo "--> Install kyma CLI locally to /tmp/bin"
curl -Lo kyma.tar.gz "https://github.com/kyma-project/cli/releases/latest/download/kyma_linux_x86_64.tar.gz" \
&& tar -zxvf kyma.tar.gz && chmod +x kyma \
&& rm -f kyma.tar.gz

kyma version --client
kyma provision gardener ${GARDENER_PROVIDER} \
--secret "${GARDENER_PROVIDER_SECRET_NAME}" \
--name "${CLUSTER_NAME}" \
--project "${GARDENER_PROJECT_NAME}" \
--credentials "${GARDENER_KUBECONFIG}" \
--region "${GARDENER_REGION}" \
--zones "${GARDENER_ZONES}" \
--type "${MACHINE_TYPE}" \
--disk-size $DISK_SIZE \
--disk-type "${DISK_TYPE}" \
--scaler-max $SCALER_MAX \
--scaler-min $SCALER_MIN \
--kube-version="${GARDENER_CLUSTER_VERSION}" \
--gardenlinux-version="${GARDENER_GARDENLINUX_VERSION}" \
--attempts 3 \
--verbose
# render and applyshoot template
shoot_template=$(envsubst < ./tests/integration/scripts/shoot_${GARDENER_PROVIDER}.yaml)

echo "$shoot_template" | kubectl --kubeconfig "${GARDENER_KUBECONFIG}" apply -f -

echo "waiting fo cluster to be ready..."
kubectl wait --kubeconfig "${GARDENER_KUBECONFIG}" --for=condition=EveryNodeReady shoot/${CLUSTER_NAME} --timeout=17m

# create kubeconfig request, that creates a kubeconfig which is valid for one day
kubectl create --kubeconfig "${GARDENER_KUBECONFIG}" \
-f <(printf '{"spec":{"expirationSeconds":86400}}') \
--raw /apis/core.gardener.cloud/v1beta1/namespaces/garden-${GARDENER_PROJECT_NAME}/shoots/${CLUSTER_NAME}/adminkubeconfig | \
jq -r ".status.kubeconfig" | \
base64 -d > ${CLUSTER_NAME}_kubeconfig.yaml

# replace the default kubeconfig
mkdir -p ~/.kube
mv ${CLUSTER_NAME}_kubeconfig.yaml ~/.kube/config
52 changes: 52 additions & 0 deletions tests/integration/scripts/shoot_aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: core.gardener.cloud/v1beta1
kind: Shoot
metadata:
name: ${CLUSTER_NAME}
spec:
secretBindingName: ${GARDENER_PROVIDER_SECRET_NAME}
cloudProfileName: aws
region: ${GARDENER_REGION}
purpose: evaluation
provider:
type: aws
infrastructureConfig:
apiVersion: aws.provider.extensions.gardener.cloud/v1alpha1
kind: InfrastructureConfig
networks:
vpc:
cidr: 10.250.0.0/16
zones:
- name: ${GARDENER_REGION}a
internal: 10.250.48.0/20
public: 10.250.32.0/20
workers: 10.250.0.0/19
- name: ${GARDENER_REGION}b
internal: 10.250.112.0/20
public: 10.250.96.0/20
workers: 10.250.64.0/19
- name: ${GARDENER_REGION}c
internal: 10.250.176.0/20
public: 10.250.160.0/20
workers: 10.250.128.0/19
workers:
- name: cpu-worker
minimum: ${SCALER_MIN}
maximum: ${SCALER_MAX}
machine:
type: ${MACHINE_TYPE}
volume:
type: ${DISK_TYPE}
size: ${DISK_SIZE}Gi
zones:
- ${GARDENER_REGION}a
- ${GARDENER_REGION}b
- ${GARDENER_REGION}c
networking:
type: calico
pods: 100.96.0.0/11
nodes: 10.250.0.0/16
services: 100.64.0.0/13
kubernetes:
version: ${GARDENER_CLUSTER_VERSION}
hibernation:
enabled: false
45 changes: 45 additions & 0 deletions tests/integration/scripts/shoot_gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: core.gardener.cloud/v1beta1
kind: Shoot
metadata:
name: ${CLUSTER_NAME}
spec:
secretBindingName: ${GARDENER_PROVIDER_SECRET_NAME}
cloudProfileName: gcp
region: ${GARDENER_REGION}
purpose: evaluation
provider:
type: gcp
infrastructureConfig:
apiVersion: gcp.provider.extensions.gardener.cloud/v1alpha1
kind: InfrastructureConfig
networks:
workers: 10.250.0.0/16
controlPlaneConfig:
apiVersion: gcp.provider.extensions.gardener.cloud/v1alpha1
kind: ControlPlaneConfig
zone: ${GARDENER_REGION}-a
workers:
- name: cpu-worker
minimum: ${SCALER_MIN}
maximum: ${SCALER_MAX}
machine:
type: ${MACHINE_TYPE}
volume:
type: ${DISK_TYPE}
size: ${DISK_SIZE}Gi
zones:
- ${GARDENER_REGION}-a
- ${GARDENER_REGION}-b
- ${GARDENER_REGION}-c
networking:
type: calico
pods: 100.96.0.0/11
nodes: 10.250.0.0/16
services: 100.64.0.0/13
kubernetes:
version: "${GARDENER_CLUSTER_VERSION}"
hibernation:
enabled: false
addons:
nginxIngress:
enabled: false
Loading