Skip to content

Commit 1b90cd0

Browse files
installs
1 parent 2846f57 commit 1b90cd0

File tree

7 files changed

+71
-80
lines changed

7 files changed

+71
-80
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ override.tf.json
3232
# Ignore CLI configuration files
3333
.terraformrc
3434
terraform.rc
35+
36+
examples/**/*.lock.hcl

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
| <a name="module_dex"></a> [dex](#module\_dex) | ./modules/kust | n/a |
2626
| <a name="module_istio_crds"></a> [istio\_crds](#module\_istio\_crds) | ./modules/kust | n/a |
2727
| <a name="module_istio_install"></a> [istio\_install](#module\_istio\_install) | ./modules/kust | n/a |
28+
| <a name="module_istio_namespace"></a> [istio\_namespace](#module\_istio\_namespace) | ./modules/kust | n/a |
2829
| <a name="module_jupyter_web_app"></a> [jupyter\_web\_app](#module\_jupyter\_web\_app) | ./modules/kust | n/a |
2930
| <a name="module_knative_serving"></a> [knative\_serving](#module\_knative\_serving) | ./modules/kust | n/a |
3031
| <a name="module_kserve"></a> [kserve](#module\_kserve) | ./modules/kust | n/a |
@@ -48,7 +49,6 @@
4849

4950
| Name | Type |
5051
|------|------|
51-
| [helm_release.external_dns](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
5252
| [helm_release.external_secrets](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
5353
| [helm_release.gatekeeper](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
5454
| [helm_release.gpu_operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
@@ -60,6 +60,7 @@
6060
| [kustomization_build.cert_manager](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
6161
| [kustomization_build.cluster_local_gateway](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
6262
| [kustomization_build.istio_crds](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
63+
| [kustomization_build.istio_namespace](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
6364
| [kustomization_build.jupyter_web_app](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
6465
| [kustomization_build.kserve](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
6566
| [kustomization_build.kubeflow_issuer](https://registry.terraform.io/providers/kbst/kustomization/latest/docs/data-sources/build) | data source |
@@ -85,7 +86,6 @@
8586

8687
| Name | Description | Type | Default | Required |
8788
|------|-------------|------|---------|:--------:|
88-
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | n/a | `string` | `"eu-west-1"` | no |
8989
| <a name="input_enable_external_dns"></a> [enable\_external\_dns](#input\_enable\_external\_dns) | n/a | `bool` | `true` | no |
9090
| <a name="input_enable_external_secrets"></a> [enable\_external\_secrets](#input\_enable\_external\_secrets) | n/a | `bool` | `false` | no |
9191
| <a name="input_enable_gatekeeper"></a> [enable\_gatekeeper](#input\_enable\_gatekeeper) | n/a | `bool` | `false` | no |
@@ -95,9 +95,7 @@
9595
| <a name="input_enable_kuberay"></a> [enable\_kuberay](#input\_enable\_kuberay) | n/a | `bool` | `false` | no |
9696
| <a name="input_enable_mlflow"></a> [enable\_mlflow](#input\_enable\_mlflow) | n/a | `bool` | `false` | no |
9797
| <a name="input_enable_tensorboard"></a> [enable\_tensorboard](#input\_enable\_tensorboard) | n/a | `bool` | `false` | no |
98-
| <a name="input_github"></a> [github](#input\_github) | n/a | <pre>object({<br> client_id = string<br> client_secret = string<br> org = string<br> })</pre> | n/a | yes |
9998
| <a name="input_hostname"></a> [hostname](#input\_hostname) | n/a | `string` | `"localhost"` | no |
100-
| <a name="input_owner_email"></a> [owner\_email](#input\_owner\_email) | The email of the owner of the Kubeflow deployment | `string` | n/a | yes |
10199
| <a name="input_port"></a> [port](#input\_port) | n/a | `string` | `"8080"` | no |
102100
| <a name="input_protocol"></a> [protocol](#input\_protocol) | n/a | `string` | `"http://"` | no |
103101

examples/k3s/main.tf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
terraform {
3+
required_providers {
4+
kustomization = {
5+
source = "kbst/kustomization"
6+
version = "~> 0.9.5"
7+
}
8+
helm = {
9+
source = "hashicorp/helm"
10+
version = "~> 2.12.1"
11+
}
12+
kubernetes = {
13+
source = "hashicorp/kubernetes"
14+
version = "~> 2.25.2"
15+
}
16+
}
17+
backend "kubernetes" {
18+
secret_suffix = "state"
19+
config_path = "/home/vscode/.kube/config"
20+
}
21+
}
22+
23+
variable "kubeconfig_path" {
24+
type = string
25+
default = "/home/vscode/.kube/config"
26+
}
27+
28+
provider "kustomization" {
29+
kubeconfig_path = var.kubeconfig_path
30+
}
31+
32+
provider "helm" {
33+
kubernetes {
34+
config_path = var.kubeconfig_path
35+
}
36+
}
37+
38+
provider "kubernetes" {
39+
config_path = var.kubeconfig_path
40+
}
41+
42+
module "treebeardkf" {
43+
source = "../.."
44+
hostname = "kf.example.com"
45+
protocol = "https://"
46+
port = ""
47+
enable_kuberay = false
48+
enable_mlflow = false
49+
}

kubeflow.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
variable "owner_email" {
2-
description = "The email of the owner of the Kubeflow deployment"
3-
type = string
4-
}
5-
61
data "kustomization_overlay" "kubeflow_profile" {
72
resources = [
83
"${path.module}/overlays/profile"
@@ -21,7 +16,7 @@ metadata:
2116
spec:
2217
owner:
2318
kind: User
24-
name: ${var.owner_email}
19+
name: user@example.com
2520
EOF
2621
}
2722
}

main.tf

Lines changed: 17 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ variable "port" {
3030
default = "8080"
3131
}
3232

33-
variable "github" {
34-
type = object({
35-
client_id = string
36-
client_secret = string
37-
org = string
38-
})
39-
}
4033

4134
locals {
4235
base_url = "${var.protocol}${var.hostname}${var.port}"
@@ -78,48 +71,19 @@ module "istio_crds" {
7871
]
7972
}
8073

81-
# data "kustomization_build" "istio_namespace" {
82-
# path = "${path.module}/submodules/manifests/common/istio-1-17/istio-namespace/base"
83-
# }
84-
85-
# module "istio_namespace" {
86-
# source = "./modules/kust"
87-
# build = data.kustomization_build.istio_namespace
88-
# depends_on = [
89-
# module.istio_crds
90-
# ]
91-
# }
92-
93-
resource "helm_release" "external_dns" {
94-
count = var.enable_external_dns ? 1 : 0
95-
name = "external-dns"
96-
chart = "external-dns"
97-
repository = "https://kubernetes-sigs.github.io/external-dns/"
98-
namespace = "istio-system"
99-
version = "1.14.0"
100-
values = [
101-
<<-EOF
102-
provider: aws
103-
env:
104-
- name: AWS_REGION
105-
value: ${var.aws_region}
106-
- name: AWS_ACCESS_KEY_ID
107-
valueFrom:
108-
secretKeyRef:
109-
name: aws-credentials
110-
key: aws_access_key_id
111-
- name: AWS_SECRET_ACCESS_KEY
112-
valueFrom:
113-
secretKeyRef:
114-
name: aws-credentials
115-
key: aws_secret_access_key
116-
EOF
117-
]
74+
data "kustomization_build" "istio_namespace" {
75+
path = "${path.module}/submodules/manifests/common/istio-1-17/istio-namespace/base"
76+
}
77+
78+
module "istio_namespace" {
79+
source = "./modules/kust"
80+
build = data.kustomization_build.istio_namespace
11881
depends_on = [
11982
module.istio_crds
12083
]
12184
}
12285

86+
12387
data "kustomization_overlay" "istio_install" {
12488
resources = [
12589
"${path.module}/overlays/istio-install"
@@ -154,7 +118,7 @@ module "istio_install" {
154118
source = "./modules/kust"
155119
build = data.kustomization_overlay.istio_install
156120
depends_on = [
157-
helm_release.external_dns
121+
module.istio_namespace
158122
]
159123
}
160124

@@ -206,32 +170,20 @@ data:
206170
oauth2:
207171
skipApprovalScreen: false
208172
enablePasswordDB: true
209-
staticPasswords: []
210-
# - email: user@example.com
211-
# hash: $2y$12$4K/VkmDd1q1Orb3xAt82zu8gk7Ad6ReFR4LCP9UeYE90NLiN9Df72
212-
# # https://github.com/dexidp/dex/pull/1601/commits
213-
# # FIXME: Use hashFromEnv instead
214-
# username: user
215-
# userID: "15841185641784"
173+
staticPasswords:
174+
- email: user@example.com
175+
hash: $2y$12$4K/VkmDd1q1Orb3xAt82zu8gk7Ad6ReFR4LCP9UeYE90NLiN9Df72
176+
# https://github.com/dexidp/dex/pull/1601/commits
177+
# FIXME: Use hashFromEnv instead
178+
username: user
179+
userID: "15841185641784"
216180
staticClients:
217181
# https://github.com/dexidp/dex/pull/1664
218182
- idEnv: OIDC_CLIENT_ID
219183
redirectURIs: ["/authservice/oidc/callback"]
220184
name: 'Dex Login Application'
221185
secretEnv: OIDC_CLIENT_SECRET
222-
connectors:
223-
- type: github
224-
id: github
225-
name: GitHub
226-
config:
227-
clientID: ${var.github.client_id}
228-
clientSecret: ${var.github.client_secret}
229-
redirectURI: ${local.base_url}/dex/callback
230-
orgs:
231-
- name: ${var.github.org}
232-
loadAllGroups: false
233-
teamNameField: slug
234-
useLoginAsID: true
186+
connectors: []
235187
EOF
236188
}
237189
}
File renamed without changes.

util.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,3 @@ variable "enable_external_dns" {
116116
type = bool
117117
default = true
118118
}
119-
120-
variable "aws_region" {
121-
type = string
122-
default = "eu-west-1"
123-
}

0 commit comments

Comments
 (0)