-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from mlinfra-io/117-feature-setup-minikube
setup minikube
- Loading branch information
Showing
49 changed files
with
605 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
`minikube` deploys MLOps `stack` on top of [minikube cluster](https://minikube.sigs.k8s.io/) on your machine. Please ensure that docker is installed and running on your machine, along with the latest version of minikube. | ||
|
||
|
||
#### Complete | ||
|
||
===+ "Simple Deployment Configuration" | ||
```yaml | ||
--8<-- "docs/examples/local/minikube.yaml" | ||
``` | ||
=== "Advanced Deployment Configuration" | ||
```yaml | ||
--8<-- "docs/examples/local/minikube-advanced.yaml" | ||
``` | ||
|
||
- Once the stacks have been deployed, there is one last step that allows the deployed stacks to be accessed on your local machine. You need to open a new terminal window and find the minikube profile that you're using `minikube profile list` and run `minikube tunnel --profile='<minikube-profile>'` to allow the services to be accessible on the local instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: local-minikube-k8s | ||
provider: | ||
name: local | ||
deployment: | ||
type: minikube | ||
config: | ||
kubernetes: | ||
nodes: 3 | ||
stack: | ||
- data_versioning: | ||
name: lakefs | ||
- experiment_tracking: | ||
name: mlflow | ||
- orchestrator: | ||
name: prefect | ||
- vector_database: | ||
name: milvus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: local-minikube-k8s | ||
provider: | ||
name: local | ||
deployment: | ||
type: minikube | ||
stack: | ||
- data_versioning: | ||
name: lakefs | ||
- experiment_tracking: | ||
name: mlflow | ||
- orchestrator: | ||
name: prefect | ||
- vector_database: | ||
name: milvus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../data_versioning/lakefs/tf_module/main.tf → .../data_versioning/lakefs/tf_module/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
inputs: | ||
- name: cluster_name | ||
user_facing: true | ||
description: "Name of the Minikube cluster" | ||
default: "minikube-cluster" | ||
- name: k8s_version | ||
user_facing: true | ||
description: "Minikube Cluster version" | ||
default: "1.30.0" | ||
- name: driver | ||
user_facing: true | ||
description: "Driver for the Minikube cluster" | ||
default: "docker" | ||
- name: nodes | ||
user_facing: true | ||
description: "Number of nodes in the Minikube cluster" | ||
default: 1 | ||
- name: add_ons | ||
user_facing: true | ||
description: "Add-ons to enable in the Minikube cluster" | ||
default: [] | ||
outputs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module "minikube" { | ||
source = "./minikube_cluster" | ||
|
||
driver = var.driver | ||
cluster_name = var.cluster_name | ||
k8s_version = var.k8s_version | ||
nodes = var.nodes | ||
add_ons = var.add_ons | ||
wait_for_addons = var.wait_for_addons | ||
wait_time = var.wait_time | ||
} |
14 changes: 14 additions & 0 deletions
14
src/mlinfra/modules/local/minikube/k8s/tf_module/minikube_cluster/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "minikube_cluster" "cluster" { | ||
driver = var.driver | ||
cluster_name = var.cluster_name | ||
kubernetes_version = var.k8s_version | ||
nodes = var.nodes | ||
wait = var.wait_for_addons | ||
|
||
addons = var.add_ons | ||
} | ||
|
||
resource "time_sleep" "cluster_creation" { | ||
create_duration = "${var.wait_time}s" | ||
depends_on = [minikube_cluster.cluster] | ||
} |
22 changes: 22 additions & 0 deletions
22
src/mlinfra/modules/local/minikube/k8s/tf_module/minikube_cluster/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
output "endpoint" { | ||
value = minikube_cluster.cluster.host | ||
description = "The endpoint of the Minikube cluster" | ||
} | ||
|
||
output "client_certificate" { | ||
value = minikube_cluster.cluster.client_certificate | ||
description = "The client certificate for accessing the Minikube cluster" | ||
sensitive = true | ||
} | ||
|
||
output "cluster_ca_certificate" { | ||
value = minikube_cluster.cluster.cluster_ca_certificate | ||
description = "The CA certificate for the Minikube cluster" | ||
sensitive = true | ||
} | ||
|
||
output "client_key" { | ||
value = minikube_cluster.cluster.client_key | ||
description = "The client key for accessing the Minikube cluster" | ||
sensitive = true | ||
} |
47 changes: 47 additions & 0 deletions
47
src/mlinfra/modules/local/minikube/k8s/tf_module/minikube_cluster/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
variable "driver" { | ||
type = string | ||
description = "The driver to be used for the Minikube cluster" | ||
default = "docker" | ||
} | ||
|
||
variable "cluster_name" { | ||
type = string | ||
description = "Name of the local minikube cluster" | ||
default = "minikube-cluster" | ||
} | ||
|
||
variable "k8s_version" { | ||
type = string | ||
description = "Defines kubernetes version for the minikube cluster" | ||
default = "1.30" | ||
} | ||
|
||
variable "nodes" { | ||
type = number | ||
description = "Number of nodes to be created for the cluster" | ||
default = 1 | ||
} | ||
|
||
variable "add_ons" { | ||
type = list(string) | ||
description = "List of add-ons to be enabled for the Minikube cluster" | ||
default = [ | ||
"default-storageclass", | ||
"storage-provisioner", | ||
"ingress" | ||
] | ||
} | ||
|
||
variable "wait_for_addons" { | ||
type = list(string) | ||
default = [ | ||
"apiserver", | ||
"system_pods", | ||
"apps_running" | ||
] | ||
} | ||
|
||
variable "wait_time" { | ||
type = number | ||
default = 20 | ||
} |
16 changes: 16 additions & 0 deletions
16
src/mlinfra/modules/local/minikube/k8s/tf_module/minikube_cluster/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This needs to be added explicitly to all modules | ||
# relying on a non-hashicorp provider. See: | ||
# https://discuss.hashicorp.com/t/using-a-non-hashicorp-provider-in-a-module/21841 | ||
terraform { | ||
required_version = ">= 1.8.0" | ||
required_providers { | ||
minikube = { | ||
source = "scott-the-programmer/minikube" | ||
version = "~> 0.4" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/mlinfra/modules/local/minikube/k8s/tf_module/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
output "endpoint" { | ||
value = module.minikube.endpoint | ||
description = "The endpoint of the Minikube cluster" | ||
} | ||
|
||
output "client_certificate" { | ||
value = module.minikube.client_certificate | ||
description = "The client certificate for accessing the Minikube cluster" | ||
sensitive = true | ||
} | ||
|
||
output "cluster_ca_certificate" { | ||
value = module.minikube.cluster_ca_certificate | ||
description = "The CA certificate for the Minikube cluster" | ||
sensitive = true | ||
} | ||
|
||
output "client_key" { | ||
value = module.minikube.client_key | ||
description = "The client key for accessing the Minikube cluster" | ||
sensitive = true | ||
} |
47 changes: 47 additions & 0 deletions
47
src/mlinfra/modules/local/minikube/k8s/tf_module/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
variable "driver" { | ||
type = string | ||
description = "The driver to be used for the Minikube cluster" | ||
default = "docker" | ||
} | ||
|
||
variable "cluster_name" { | ||
type = string | ||
description = "Name of the local minikube cluster" | ||
default = "minikube-cluster" | ||
} | ||
|
||
variable "k8s_version" { | ||
type = string | ||
description = "Defines kubernetes version for the minikube cluster" | ||
default = "1.30" | ||
} | ||
|
||
variable "nodes" { | ||
type = number | ||
description = "Number of nodes to be created for the cluster" | ||
default = 1 | ||
} | ||
|
||
variable "add_ons" { | ||
type = list(string) | ||
description = "List of add-ons to be enabled for the Minikube cluster" | ||
default = [ | ||
"default-storageclass", | ||
"storage-provisioner", | ||
"ingress" | ||
] | ||
} | ||
|
||
variable "wait_for_addons" { | ||
type = list(string) | ||
default = [ | ||
"apiserver", | ||
"system_pods", | ||
"apps_running" | ||
] | ||
} | ||
|
||
variable "wait_time" { | ||
type = number | ||
default = 20 | ||
} |
16 changes: 16 additions & 0 deletions
16
src/mlinfra/modules/local/minikube/k8s/tf_module/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This needs to be added explicitly to all modules | ||
# relying on a non-hashicorp provider. See: | ||
# https://discuss.hashicorp.com/t/using-a-non-hashicorp-provider-in-a-module/21841 | ||
terraform { | ||
required_version = ">= 1.8.0" | ||
required_providers { | ||
minikube = { | ||
source = "scott-the-programmer/minikube" | ||
version = "~> 0.4" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"provider": { | ||
"minikube": {} | ||
} | ||
} |
Oops, something went wrong.