Skip to content

Commit

Permalink
Merge pull request #10 from aigisuk/develop
Browse files Browse the repository at this point in the history
🔥 remove k8s dashboard temp configuration
🐛 fix GitHub Actions
  • Loading branch information
colinwilson authored Apr 28, 2021
2 parents 562cb81 + 7cd0048 commit 084cace
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 21 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 'Terraform GitHub Actions'

on:
push:
branches:
- release
pull_request:

jobs:
Expand Down Expand Up @@ -49,7 +46,7 @@ jobs:
needs: terraform-fmt
runs-on: ubuntu-latest
env:
WORKING_DIR: "examples/default_deployment"
WORKING_DIR: "examples/github_actions"
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion examples/default_deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ This example illustrates how to use the `terraform-digitalocean-ha-k3s` module.

## Outputs

TBC
| Name | Description |
|------|-------------|
| cluster_summary | A summary of the cluster's provisioned resources. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
9 changes: 0 additions & 9 deletions examples/default_deployment/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
terraform {
# Reconfigure the backend block to suit your needs
backend "remote" {
hostname = "app.terraform.io"
organization = "AIGISUK"

workspaces {
name = "gh-actions-terraform-digitalocean-ha-k3s"
}
}
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
Expand Down
17 changes: 17 additions & 0 deletions examples/github_actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# GitHub Actions Deployment Example

This example is specifically for module tests.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| do_token | DigitalOcean Personal Access Token | string | N/A | yes |
| ssh_key_fingerprints | List of SSH Key fingerprints | list(string) | N/A | yes |

## Outputs

| Name | Description |
|------|-------------|
| cluster_summary | A summary of the cluster's provisioned resources. |
26 changes: 26 additions & 0 deletions examples/github_actions/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
terraform {
# Reconfigure the backend block to suit your needs
backend "remote" {
hostname = "app.terraform.io"
organization = "AIGISUK"

workspaces {
name = "gh-actions-terraform-digitalocean-ha-k3s"
}
}
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
}
required_version = ">= 0.13"
}

provider "digitalocean" {}

module "ha-k3s" {
source = "git::https://github.com/aigisuk/terraform-digitalocean-ha-k3s.git?ref=develop"

do_token = var.do_token
ssh_key_fingerprints = var.ssh_key_fingerprints
}
3 changes: 3 additions & 0 deletions examples/github_actions/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "cluster_summary" {
value = module.ha-k3s.cluster_summary
}
2 changes: 2 additions & 0 deletions examples/github_actions/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variable "ssh_key_fingerprints" {}
variable "do_token" {}
1 change: 0 additions & 1 deletion server_init.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ resource "digitalocean_droplet" "k3s_server_init" {
csi_crds_manifest = file("${path.module}/manifests/do-csi/crds.yaml")
csi_driver_manifest = file("${path.module}/manifests/do-csi/driver.yaml")
csi_sc_manifest = file("${path.module}/manifests/do-csi/snapshot-controller.yaml")
#k8s_dashboard = file("${path.module}/manifests/k8s-dashboard.yaml")
})
}

Expand Down
7 changes: 1 addition & 6 deletions user_data/ks3_server_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,4 @@ EOF
# csi snapshot controller
cat <<'EOF' | sudo tee /var/lib/rancher/k3s/server/manifests/snapshot-controller.yaml
${csi_sc_manifest}
EOF

# kubernetes dashboard
# cat <<'EOF' | sudo tee /var/lib/rancher/k3s/server/manifests/k8s-dashboard.yaml
# ${k8s_dashboard}
# EOF
EOF

0 comments on commit 084cace

Please sign in to comment.