init k8s guide

This commit is contained in:
2023-08-24 14:42:05 +02:00
parent 0caa13f5d1
commit c61c4f1fa0
3 changed files with 38 additions and 7 deletions

View File

@ -328,7 +328,7 @@ resource "kubernetes_manifest" "longhorn_ingress" {
services = [
{
name = "longhorn-frontend"
port = 80
port = "http"
}
]
}

View File

@ -186,7 +186,7 @@ resource "kubernetes_manifest" "prometheus_ingress" {
services = [
{
name = "prometheus-operated"
port = 9090
port = "http-web"
}
]
}
@ -413,7 +413,7 @@ resource "kubernetes_manifest" "grafana_ingress" {
services = [
{
name = "grafana"
port = 80
port = "service"
}
]
}

View File

@ -25,6 +25,19 @@ The Gitea Helm Chart is a bit tricky to configure properly. Let's begin with som
{{< highlight host="demo-kube-k3s" file="main.tf" >}}
```tf
variable "gitea_admin_username" {
type = string
}
variable "gitea_admin_password" {
type = string
sensitive = true
}
variable "gitea_admin_email" {
type = string
}
variable "gitea_db_password" {
type = string
sensitive = true
@ -36,7 +49,10 @@ variable "gitea_db_password" {
{{< highlight host="demo-kube-k3s" file="terraform.tfvars" >}}
```tf
gitea_db_password = "xxx"
gitea_admin_username = "kuberocks"
gitea_admin_password = "xxx"
gitea_admin_email = "admin@kube.rocks"
gitea_db_password = "xxx"
```
{{< /highlight >}}
@ -62,6 +78,21 @@ resource "helm_release" "gitea" {
name = "gitea"
namespace = kubernetes_namespace_v1.gitea.metadata[0].name
set {
name = "gitea.admin.username"
value = var.gitea_admin_username
}
set {
name = "gitea.admin.password"
value = var.gitea_admin_password
}
set {
name = "gitea.admin.email"
value = var.gitea_admin_email
}
set {
name = "strategy.type"
value = "Recreate"
@ -221,7 +252,7 @@ resource "helm_release" "gitea" {
{{< /highlight >}}
Note as we disable included Redis and PostgreSQL, because we use our own Redis and PostgreSQL cluster. We'll try to have a working SSH service too.
Note as we disable included Redis and PostgreSQL sub charts, because w'l reuse our existing ones. Also note the use of `urlencode` function for Redis password, as it can contain special characters.
The related ingress:
@ -245,7 +276,7 @@ resource "kubernetes_manifest" "gitea_ingress" {
services = [
{
name = "gitea-http"
port = 3000
port = "http"
}
]
}
@ -257,7 +288,7 @@ resource "kubernetes_manifest" "gitea_ingress" {
{{< /highlight >}}
Go login in `https://gitea.kube.rocks` with default next credentials *gitea_admin / r8sA8CPHD9!bt6d*, and **change them immediately**.
Go log in `https://gitea.kube.rocks` with chosen admin credentials.
### Push our first app