【发布时间】:2026-01-12 21:00:01
【问题描述】:
我正在尝试在 eks 集群上部署此基本 nginx 映像,但在尝试访问公共 IP 时似乎无法访问它。 我正在使用官方 EKS 模块并进行以下设置:
我还使用 k8s 提供程序进行了此部署设置:
resource "kubernetes_deployment" "helloworld" {
metadata {
name = "helloworld"
}
spec {
replicas = 2
selector {
match_labels = {
app = "helloworld"
}
}
template {
metadata {
labels = {
app = "helloworld"
}
}
spec {
container {
name = "nginx"
image = "nginx"
port {
container_port = 80
}
}
}
}
}
}
resource "kubernetes_service" "example" {
metadata {
name = "helloworld"
}
spec {
selector = {
app = "helloworld"
}
session_affinity = "ClientIP"
port {
port = 8080
target_port = 80
}
type = "NodePort"
}
}
当我去检查kubectl describe pods时,我被告知服务无法访问:
我在这里错过了什么?
【问题讨论】:
-
分享描述 pod 截图或细节,而不是用自己的话。
-
@HarshManvar 我添加了更新截图
-
您是如何尝试访问该服务的?所以使用 terraform pod 被部署但之后面临问题是这样吗?你试过
:
标签: amazon-web-services kubernetes terraform