Skip to content

Commit 02e5c59

Browse files
authored
Merge pull request #15 from wainersm/updates
Update docs regarding expired tokens
2 parents 684f4a9 + 9ee653b commit 02e5c59

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

github/azure-self-hosted-runners/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,15 @@ The application is deployed as an [ACI](https://azure.microsoft.com/en-us/produc
2222

2323
### Deployment
2424

25-
Github tokens (see above) need to be passed to Garm via tf variables, either by creating a `tf/terraform.tfvars` or specifying it on the cli:
25+
Github tokens (see above) are passed to Garm via Azure Key Vault secrets. So first you should put the tokens as secrets in
26+
a Key Vault. The Key Vault id is then passed to terraform either by creating a `tf/terraform.tfvars` or specifying it on the cli:
2627

2728
```hcl
28-
github_tokens = [
29-
{
30-
name = "some name"
31-
token = "abc123"
32-
},
33-
]
29+
github_token_key_vault_id = "the vault id"
3430
```
3531

3632
```bash
37-
terraform apply -var='github_tokens=[{"name":"some name","token":"abc123"}]'
33+
terraform apply -var='github_token_key_vault_id="the vault id"'
3834
```
3935

4036
## Configuration
@@ -125,3 +121,19 @@ $ az container logs -g garm -n garm-kg1ocu --container-name garm --follow
125121
}
126122
127.0.0.1 - - [02/Jun/2023:13:01:21 +0000] "GET /api/v1/metadata/runner-registration-token/ HTTP/1.1" 200 29 "" "curl/7.81.0"
127123
```
124+
125+
## Updating expired Github tokens
126+
127+
The Github tokens should be updated in the Garm installation from time-to-time because they expire. You will need to re-generate the expired token(s) first.
128+
129+
Then you will need to update its value on the Key Vault. For example, suppose the new token is "github_pat_xxxxxxxx", to update the "garm" secret in the "garm-github-tokens" vault:
130+
131+
```
132+
$ az keyvault secret set --value github_pat_xxxxxxxx --name garm --vault-name garm-github-tokens
133+
```
134+
135+
Finally you will need to re-deploy Garm:
136+
137+
```bash
138+
$ terraform apply
139+
```

github/azure-self-hosted-runners/tf/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ variable "vm_location" {
1818

1919
variable "garm_image" {
2020
type = string
21-
default = "ghcr.io/confidential-containers/garm:main"
21+
default = "ghcr.io/confidential-containers/garm@sha256:c79f9231ef52e8be9141623e3ef67bae0ab373e4ad5b0b6cee78e20fb54f994c"
2222
description = "Container image for garm"
2323
}
2424

2525
variable "caddy_image" {
2626
type = string
27-
default = "caddy:2.6.4"
27+
default = "ghcr.io/confidential-containers/caddy:2.6.4"
2828
description = "Container image for caddy"
2929
}
3030

0 commit comments

Comments
 (0)