我已经在私有子网中创建了一个带有Fargate配置文件的eks集群。之后,我已经修补coredns与Fargate注解,但coredns pod仍处于挂起状态后,发出下面的命令,并重新启动
kubectl patch deployment coredns \
-n kube-system \
--type json \
-p='[{"op": "remove", "path": "/spec/template/metadata/annotations/eks.amazonaws.com~1compute-type"}]'
Terraform配置 www.example.com
resource "aws_eks_cluster" "eks_cluster" {
name = var.cluster_name
role_arn = var.cluster_role
version = var.cluster_version
enabled_cluster_log_types = var.cluster_enabled_log_types
vpc_config {
security_group_ids = compact(distinct(concat(var.cluster_additional_security_group_ids, [var.cluster_security_group_id])))
subnet_ids = coalescelist(var.control_plane_subnet_ids, var.subnet_ids)
endpoint_private_access = var.cluster_endpoint_private_access
endpoint_public_access = var.cluster_endpoint_public_access
public_access_cidrs = var.cluster_endpoint_public_access_cidrs
}
kubernetes_network_config {
ip_family = var.cluster_ip_family
service_ipv4_cidr = var.cluster_service_ipv4_cidr
}
tags = merge(
var.tags,
var.cluster_tags,
)
}
Fargate剖面
resource "aws_eks_fargate_profile" "eks_fargate" {
count = var.create ? 1 : 0
cluster_name = var.cluster_name
fargate_profile_name = var.fargate_profile_name
pod_execution_role_arn = var.iam_role_arn
subnet_ids = var.subnet_ids
selector {
namespace = var.selectors
}
dynamic "timeouts" {
for_each = [var.timeouts]
content {
create = lookup(var.timeouts, "create", null)
delete = lookup(var.timeouts, "delete", null)
}
}
tags = var.tags
}
Coredns pod详细信息
Name: coredns-78dcd9fb45-tv6vn
Namespace: kube-system
Priority: 2000001000
Priority Class Name: system-node-critical
Service Account: coredns
Node: <none>
Labels: eks.amazonaws.com/component=coredns
eks.amazonaws.com/fargate-profile=hds-fargate-profile
k8s-app=kube-dns
pod-template-hash=78dcd9fb45
Annotations: CapacityProvisioned: 0.25vCPU 0.5GB
Logging: LoggingDisabled: LOGGING_CONFIGMAP_NOT_FOUND
eks.amazonaws.com/compute-type: fargate
kubectl.kubernetes.io/restartedAt: 2022-11-21T14:10:45+05:30
kubernetes.io/psp: eks.privileged
Status: Pending
IP:
IPs: <none>
Controlled By: ReplicaSet/coredns-78dcd9fb45
NominatedNodeName: 5367f7aa1d-a9be6cbb0883413ca6cc82f2aa194a17
Containers:
coredns:
Image: 602401143452.dkr.ecr.us-east-2.amazonaws.com/eks/coredns:v1.8.7-eksbuild.1
Ports: 53/UDP, 53/TCP, 9153/TCP
Host Ports: 0/UDP, 0/TCP, 0/TCP
Args:
-conf
/etc/coredns/Corefile
Limits:
memory: 170Mi
Requests:
cpu: 100m
memory: 70Mi
Liveness: http-get http://:8080/health delay=60s timeout=5s period=10s #success=1 #failure=5
Readiness: http-get http://:8080/health delay=0s timeout=1s period=10s #success=1 #failure=3
Environment: <none>
Mounts:
/etc/coredns from config-volume (ro)
/tmp from tmp (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-9ldq9 (ro)
Volumes:
tmp:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
config-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: coredns
Optional: false
kube-api-access-9ldq9:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: CriticalAddonsOnly op=Exists
node-role.kubernetes.io/master:NoSchedule
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning LoggingDisabled 32m fargate-scheduler Disabled logging because aws-logging configmap was not found. configmap "aws-logging" not found
Warning FailedScheduling 29m fargate-scheduler Pod provisioning timed out (will retry) for pod: kube-system/coredns-78dcd9fb45-tv6vn
Warning FailedScheduling 26m fargate-scheduler Pod provisioning timed out (will retry) for pod: kube-system/coredns-78dcd9fb45-tv6vn
Warning LoggingDisabled 26m fargate-scheduler Disabled logging because aws-logging configmap was not found. configmap "aws-logging" not found
Warning FailedScheduling 23m fargate-scheduler Pod provisioning timed out (will retry) for pod: kube-system/coredns-78dcd9fb45-tv6vn
任何帮助都非常感谢
1条答案
按热度按时间ryhaxcpt1#
删除nodeAffinity部分帮助了我: