Skip to content

Commit

Permalink
chore: User PR number as id (#13)
Browse files Browse the repository at this point in the history
* Use pr number as id

* F
  • Loading branch information
nahsi authored Nov 26, 2024
1 parent dd3b8c7 commit 6dfef13
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
with:
command: "destroy"
branch: ${{ github.event.pull_request.head.ref }}
workspace: "spectrum-${{ github.event.pull_request.head.ref }}"
workspace: "spectrum-${{ github.event.pull_request.number }}"
secrets:
PAT: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: ./.github/workflows/terraform.yml
with:
command: create
workspace: "spectrum-${{ github.head_ref }}"
workspace: "spectrum-${{ github.event.number }}"
branch: ${{ github.event.pull_request.head.ref }}
secrets:
PAT: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
## ephemeral: ${{ steps.sanitize.outputs.workspace }}
Your ephemeral k8s cluster is ready.
Visit the dashboard at https://home.rnd-${{ steps.sanitize.outputs.workspace }}.fluence.dev
Visit the dashboard at https://home.${{ steps.sanitize.outputs.workspace }}.fluence.dev
You can obtain kubeconfig and talos config from this [artifact](${{ steps.artifact.outputs.artifact-url }}).
Download and unarchive the artifact, then run this command to export variables:
Expand Down
13 changes: 13 additions & 0 deletions flux/apps/ingress-nginx/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,16 @@ spec:
http: 30100
https: 30101
externalTrafficPolicy: Local
ingress:
enabled: true
hosts:
- kube.${DOMAIN}
ingressClassName: nginx
useDefaultAnnotations: true
pathType: ImplementationSpecific
path: /
issuer:
name: letsencrypt
scope: cluster
tls:
enabled: true
10 changes: 8 additions & 2 deletions terraform/controlplane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
}

resource "digitalocean_loadbalancer" "cp" {
name = "${local.prefix}-controlplane"
name = "rnd-${local.prefix}-controlplane"
region = "fra1"
vpc_uuid = data.digitalocean_vpc.spectrum.id

Expand Down Expand Up @@ -92,7 +92,7 @@ data "talos_client_configuration" "this" {
resource "digitalocean_droplet" "cp" {
for_each = { for index, name in local.cp : name => index }

name = "${local.prefix}-spectrum-${each.key}"
name = "rnd-${local.prefix}-spectrum-${each.key}"
size = "s-4vcpu-8gb"
image = data.digitalocean_image.talos.id
region = "fra1"
Expand Down Expand Up @@ -122,6 +122,9 @@ resource "talos_machine_bootstrap" "this" {
client_configuration = talos_machine_secrets.this.client_configuration
endpoint = digitalocean_droplet.cp["cp-0"].ipv4_address
node = digitalocean_droplet.cp["cp-0"].ipv4_address
timeouts = {
create = "3m"
}

lifecycle {
replace_triggered_by = [
Expand All @@ -133,6 +136,9 @@ resource "talos_machine_bootstrap" "this" {
resource "talos_cluster_kubeconfig" "this" {
client_configuration = talos_machine_secrets.this.client_configuration
node = digitalocean_droplet.cp["cp-0"].ipv4_address
timeouts = {
create = "3m"
}
}

# data "talos_cluster_health" "health" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
prefix = "rnd-${terraform.workspace}"
prefix = terraform.workspace
loadbalancer_dns = "kube.${local.prefix}.fluence.dev"

docker_config_json = jsonencode({
Expand Down

0 comments on commit 6dfef13

Please sign in to comment.