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

feat/cloudprofile #24

Merged
merged 4 commits into from
Oct 5, 2021
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
4 changes: 3 additions & 1 deletion .github/workflows/shoot-from-scratch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
run: nix-shell --command 'bash hack/ci/07-tests.sh'
- name: Install Gardenlet
id: installGardenlet
run: nix-shell --command 'bash hack/ci/08-gardenlet.sh'
run: nix-shell --command 'echo "$CLOUD_SECRET" > hack/scerets/hcloud_token ; bash hack/ci/08-gardenlet.sh'
env:
CLOUD_SECRET: ${{ secrets.HCLOUD_TESTING_TOKEN }}
- name: Delete shoot
run: nix-shell --command 'bash hack/ci/delete-shoot.sh'
- name: Delete shoot after failure
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ flux_*
*.DS_STORE*
hack/dev-env/gardenlet/garden-content/token.yaml
hack/dev-env/gardenlet/config/internal-gardenlet-values.yaml
hack/secrets/*
hack/dev-env/gardenlet/garden-content/cloud_secret.yaml
4 changes: 4 additions & 0 deletions hack/ci/08-gardenlet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ yq eval '.stringData.token-id = env(TOKEN_ID)' hack/dev-env/gardenlet/garden-con
yq eval '.metadata.name = "bootstrap-token-" + env(TOKEN_ID)' -i hack/dev-env/gardenlet/garden-content/token.yaml
yq eval '.stringData.token-secret = env(TOKEN_ID_SECRET)' -i hack/dev-env/gardenlet/garden-content/token.yaml

export CLOUD_TOKEN=$(cat hack/secrets/hcloud_token)
yq eval '.data.hcloudToken = env(CLOUD_TOKEN)' hack/dev-env/gardenlet/garden-content/cloud_secret.yaml.tmpl > hack/dev-env/gardenlet/garden-content/cloud_secret.yaml

bash hack/ci/05-config-bucket.sh > /dev/null

rm hack/dev-env/gardenlet/garden-content/token.yaml
rm hack/dev-env/gardenlet/config/internal-gardenlet-values.yaml

flux create ks 23ke-env-gardenlet --source=Bucket/23ke-config --path=./dev-env/gardenlet > /tmp/stdout 2> /tmp/stderr || { echo -e "\rError while creating gardenlet kustomization ❌"; echo "STDOUT":; cat /tmp/stdout; echo "STDERR:"; cat /tmp/stderr; exit 1; }

8 changes: 8 additions & 0 deletions hack/dev-env/gardenlet/garden-content/cloud_secret.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: cloud-secret
namespace: garden-testing
type: Opaque
data:
hcloudToken: ...
115 changes: 115 additions & 0 deletions hack/dev-env/gardenlet/garden-content/cpfl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
apiVersion: core.gardener.cloud/v1beta1
kind: CloudProfile
metadata:
name: hcloud
spec:
type: hcloud
kubernetes:
versions:
- version: 1.20.11
classification: supported
machineImages:
- name: ubuntu
versions:
- version: 20.4.20210616
cri:
- name: containerd
machineTypes:
- name: cx21
cpu: "2"
memory: 4Gi
gpu: "0"
- name: cpx21
cpu: "3"
memory: 4Gi
gpu: "0"
- name: cx31
cpu: "2"
memory: 8Gi
gpu: "0"
- name: cpx31
cpu: "4"
memory: 8Gi
gpu: "0"
- name: cx41
cpu: "4"
memory: 16Gi
gpu: "0"
- name: cpx41
cpu: "8"
memory: 16Gi
gpu: "0"
- name: cx51
cpu: "8"
memory: 32Gi
gpu: "0"
- name: cpx51
cpu: "16"
memory: 32Gi
gpu: "0"
- name: ccx11
cpu: "2"
memory: 8Gi
gpu: "0"
- name: ccx12
cpu: "2"
memory: 8Gi
gpu: "0"
- name: ccx21
cpu: "4"
memory: 16Gi
gpu: "0"
- name: ccx22
cpu: "4"
memory: 16Gi
gpu: "0"
- name: ccx31
cpu: "8"
memory: 32Gi
gpu: "0"
- name: ccx32
cpu: "8"
memory: 32Gi
gpu: "0"
- name: ccx41
cpu: "16"
memory: 64Gi
gpu: "0"
- name: ccx42
cpu: "16"
memory: 64Gi
gpu: "0"
- name: ccx51
cpu: "32"
memory: 128Gi
gpu: "0"
- name: ccx52
cpu: "32"
memory: 128Gi
gpu: "0"
- name: ccx62
cpu: "48"
memory: 192Gi
gpu: "0"
regions:
- name: hel1
zones:
- name: hel1-dc2
- name: fsn1
zones:
- name: fsn1-dc14
- name: nbg1
zones:
- name: nbg1-dc3
providerConfig:
apiVersion: hcloud.provider.extensions.gardener.cloud/v1alpha1
kind: CloudProfileConfig
machineImages:
- name: ubuntu
versions:
- version: 20.4.20210616
imageName: ubuntu-20.04
regions:
- name: hel1
- name: fsn1
- name: nbg1
4 changes: 4 additions & 0 deletions hack/dev-env/gardenlet/garden-content/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- token.yaml
- cpfl.yaml
- project.yaml
- cloud_secret.yaml
- secret_binding.yaml
19 changes: 19 additions & 0 deletions hack/dev-env/gardenlet/garden-content/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Namespace
metadata:
name: garden-testing
labels:
gardener.cloud/role: project
project.gardener.cloud/name: testing
---
apiVersion: core.gardener.cloud/v1beta1
kind: Project
metadata:
name: testing
spec:
owner:
apiGroup: rbac.authorization.k8s.io
kind: User
name: admin@localhost
members: []
namespace: garden-testing
10 changes: 10 additions & 0 deletions hack/dev-env/gardenlet/garden-content/secret_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: core.gardener.cloud/v1beta1
kind: SecretBinding
metadata:
labels:
cloudprofile.garden.sapcloud.io/name: hcloud
name: cloud-secret
namespace: garden-testing
secretRef:
name: cloud-secret
namespace: garden-testing