Skip to content

Commit 5e8ec1c

Browse files
committed
new module kubernetes secrets
1 parent dc99d34 commit 5e8ec1c

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
type: kubernetes.io/dockerconfigjson
5+
metadata:
6+
#name: dockerconfigjson-github-com
7+
name: ${secret_name}
8+
namespace: ${namespace}
9+
labels:
10+
app: app-name
11+
data:
12+
.dockerconfigjson: ${ghcr_secret}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
data "template_file" "ghcr_secret" {
2+
template = file("${path.module}/ghcr-secret.tpl.yaml")
3+
4+
vars = {
5+
ghcr_secret = var.ghcr_secret
6+
namespace = var.namespace
7+
}
8+
}
9+
10+
resource "kubectl_manifest" "ghcr_secret" {
11+
yaml_body = data.template_file.ghcr_secret.rendered
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#namespace of the application
2+
variable "namespace" {
3+
type = string
4+
}
5+
6+
#name of the secret for using for reference
7+
variable "secret_name" {
8+
type = string
9+
}
10+
11+
#value of the json for authorize ghcr
12+
variable "ghcr_secret" {
13+
type = string
14+
}

0 commit comments

Comments
 (0)