Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kserve and add some fixes #35

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions aws-kubeflow-kserve/kserve-module/istio.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# set up istio for kserve
resource "null_resource" "create-istio-kserve" {
provisioner "local-exec" {
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
# repeating the same command as a hack to prevent errors in subsequent commands
# running it only once would have caused the next command to fail with no envoyfilter CRDs.
provisioner "local-exec" {
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/net-istio.yaml"
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/net-istio.yaml"
}

# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl delete -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/net-istio.yaml"
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/net-istio.yaml --ignore-not-found"
}

depends_on = [
Expand Down
8 changes: 4 additions & 4 deletions aws-kubeflow-kserve/kserve-module/knative_serving.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# set up istio for kserve
resource "null_resource" "create-knative-serving" {
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-crds.yaml"
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-crds.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-core.yaml"
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-core.yaml"
}

# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-crds.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-crds.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-core.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-core.yaml --ignore-not-found"
}

}
14 changes: 7 additions & 7 deletions gcp-kubeflow-kserve/kserve-module/istio.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# set up istio for kserve
resource "null_resource" "create-istio-kserve" {
provisioner "local-exec" {
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
# repeating the same command as a hack to prevent errors in subsequent commands
# running it only once would have caused the next command to fail with no envoyfilter CRDs.
provisioner "local-exec" {
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/net-istio.yaml"
command = "kubectl apply -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/net-istio.yaml"
}

# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl delete -l knative.dev/crd-install=true -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/istio.yaml"
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/istio.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.6.0/net-istio.yaml"
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v1.9.0/net-istio.yaml --ignore-not-found"
}

depends_on = [
Expand Down
8 changes: 4 additions & 4 deletions gcp-kubeflow-kserve/kserve-module/knative_serving.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# set up istio for kserve
resource "null_resource" "create-knative-serving" {
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-crds.yaml"
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-crds.yaml"
}
provisioner "local-exec" {
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-core.yaml"
command = "kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-core.yaml"
}

# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-crds.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-crds.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.6.0/serving-core.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v1.9.0/serving-core.yaml --ignore-not-found"
}

}
4 changes: 2 additions & 2 deletions gcp-kubeflow-kserve/kserve-module/kserve.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ resource "null_resource" "kserve" {
# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v0.9.0/kserve.yaml"
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v0.9.0/kserve.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v0.9.0/kserve-runtimes.yaml"
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v0.9.0/kserve-runtimes.yaml --ignore-not-found"
}

depends_on = [
Expand Down
25 changes: 25 additions & 0 deletions gcp-kubeflow-kserve/kubeflow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,29 @@ resource "null_resource" "kubeflow" {
null_resource.configure-local-kubectl,
module.gke,
]
}


# allow the kubeflow kubernetes sa to access GKE's IAM role
# the GKE IAM role should have access to Storage resources
resource "google_service_account_iam_member" "kubeflow-storage-access" {
service_account_id = google_service_account.gke-service-account.name
role = "roles/iam.workloadIdentityUser"
member = "serviceAccount:${local.project_id}.svc.id.goog[kubeflow/default]"
depends_on = [
null_resource.kubeflow
]
}

# add annotation to kubernetes sa pipeline-runner
resource "kubernetes_annotations" "pipeline-runner" {
api_version = "v1"
kind = "ServiceAccount"
metadata {
name = "pipeline-runner"
namespace = "kubeflow"
}
annotations = {
"iam.gke.io/gcp-service-account" = "${google_service_account.gke-service-account.email}"
}
}
6 changes: 3 additions & 3 deletions modules/kserve-module/knative_serving.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ resource "null_resource" "knative-serving" {
# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v${self.triggers.knative_version}/net-istio.yaml"
command = "kubectl delete -f https://github.com/knative/net-istio/releases/download/knative-v${self.triggers.knative_version}/net-istio.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v${self.triggers.knative_version}/serving-core.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v${self.triggers.knative_version}/serving-core.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v${self.triggers.knative_version}/serving-crds.yaml"
command = "kubectl delete -f https://github.com/knative/serving/releases/download/knative-v${self.triggers.knative_version}/serving-crds.yaml --ignore-not-found"
}

}
4 changes: 2 additions & 2 deletions modules/kserve-module/kserve.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ resource "null_resource" "kserve" {
# destroy-time provisioners
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v${self.triggers.kserve_version}/kserve-runtimes.yaml"
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v${self.triggers.kserve_version}/kserve-runtimes.yaml --ignore-not-found"
}
provisioner "local-exec" {
when = destroy
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v${self.triggers.kserve_version}/kserve.yaml"
command = "kubectl delete -f https://github.com/kserve/kserve/releases/download/v${self.triggers.kserve_version}/kserve.yaml --ignore-not-found"
}

depends_on = [
Expand Down