Skip to content

Commit

Permalink
Updated AWS and GCP configurations for kubeip deployment with new tol…
Browse files Browse the repository at this point in the history
…erations and rolling update strategy. (#141)
  • Loading branch information
alexei-led authored Apr 1, 2024
1 parent ccafb85 commit a87be9f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
16 changes: 15 additions & 1 deletion examples/aws/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ resource "kubernetes_cluster_role" "kubeip_cluster_role" {
rule {
api_groups = ["coordination.k8s.io"]
resources = ["leases"]
verbs = ["create", "delete", "get", "list", "update"]
verbs = ["create", "delete", "get"]
}
depends_on = [
kubernetes_service_account.kubeip_service_account,
Expand Down Expand Up @@ -215,6 +215,12 @@ resource "kubernetes_daemonset" "kubeip_daemonset" {
app = "kubeip"
}
}
strategy {
type = "RollingUpdate"
rolling_update {
max_unavailable = 1
}
}
template {
metadata {
labels = {
Expand All @@ -225,6 +231,14 @@ resource "kubernetes_daemonset" "kubeip_daemonset" {
service_account_name = "kubeip-service-account"
termination_grace_period_seconds = 30
priority_class_name = "system-node-critical"
toleration {
effect = "NoSchedule"
operator = "Exists"
}
toleration {
effect = "NoExecute"
operator = "Exists"
}
container {
name = "kubeip-agent"
image = "doitintl/kubeip-agent:${var.kubeip_version}"
Expand Down
24 changes: 23 additions & 1 deletion examples/gcp/gke.tf
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ resource "kubernetes_cluster_role" "kubeip_cluster_role" {
rule {
api_groups = ["coordination.k8s.io"]
resources = ["leases"]
verbs = ["create", "delete", "get", "list", "update"]
verbs = ["create", "delete", "get"]
}
depends_on = [
kubernetes_service_account.kubeip_service_account,
Expand Down Expand Up @@ -274,6 +274,12 @@ resource "kubernetes_daemonset" "kubeip_daemonset" {
app = "kubeip"
}
}
strategy {
type = "RollingUpdate"
rolling_update {
max_unavailable = 1
}
}
template {
metadata {
labels = {
Expand All @@ -284,6 +290,14 @@ resource "kubernetes_daemonset" "kubeip_daemonset" {
service_account_name = "kubeip-service-account"
termination_grace_period_seconds = 30
priority_class_name = "system-node-critical"
toleration {
effect = "NoSchedule"
operator = "Exists"
}
toleration {
effect = "NoExecute"
operator = "Exists"
}
container {
name = "kubeip-agent"
image = "doitintl/kubeip-agent:${var.kubeip_version}"
Expand Down Expand Up @@ -312,6 +326,14 @@ resource "kubernetes_daemonset" "kubeip_daemonset" {
name = "LEASE_DURATION"
value = "20"
}
env {
name = "LEASE_NAMESPACE"
value_from {
field_ref {
field_path = "metadata.namespace"
}
}
}
resources {
requests = {
cpu = "100m"
Expand Down

0 comments on commit a87be9f

Please sign in to comment.