sparse-intern-71089
09/06/2022, 10:17 PMsalmon-account-74572
09/06/2022, 10:36 PMvictorious-dusk-75271
09/06/2022, 10:45 PMvictorious-dusk-75271
09/06/2022, 10:45 PMconst provider = new k8s.Provider(`${this.clusterName}-k8s-provider`, {
kubeconfig: this.cluster.kubeconfig,
enableServerSideApply: true
}, { provider: this.provider })
return new k8s.apps.v1.DeploymentPatch(`${this.clusterName}-coredns-deployment-patch`, {
metadata: {
annotations: {
"pulumi.com/patchForce": "true",
},
name: 'coredns',
},
spec: {
template: {
spec: {
affinity: {
podAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
weight: 100,
podAffinityTerm: {
topologyKey: 'kubernetes.io/hostname',
labelSelector: {
matchExpressions: [{
key: 'k8s-app',
operator: 'In',
values: ['kube-dns']
}]
}
}
}]
}
}
}
}
}
}, { provider: provider, parent: this.cluster.provider })victorious-dusk-75271
09/06/2022, 10:45 PMerror: resource default/coredns was not successfully created by the Kubernetes API server : Deployment.apps "coredns" is invalid
: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string(nil): `selector` does not match te
mplate `labels`, spec.template.spec.containers: Required value]salmon-account-74572
09/06/2022, 10:47 PMkubectl, if at all possible.victorious-dusk-75271
09/06/2022, 10:49 PMkd deployment -n kube-system coredns
Name: coredns
Namespace: kube-system
CreationTimestamp: Tue, 06 Sep 2022 03:51:27 +0600
Labels: eks.amazonaws.com/component=coredns
k8s-app=kube-dns
kubernetes.io/name=CoreDNS
Annotations: deployment.kubernetes.io/revision: 3
Selector: eks.amazonaws.com/component=coredns,k8s-app=kube-dns
Replicas: 2 desired | 2 updated | 2 total | 2 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 1 max unavailable, 25% max surge
Pod Template:
Labels: eks.amazonaws.com/component=coredns
k8s-app=kube-dns
Annotations: eks.amazonaws.com/compute-type: ec2
kubectl.kubernetes.io/restartedAt: 2022-09-07T02:02:37+06:00
Service Account: coredns
Containers:
coredns:
Image: 602401143452.dkr.ecr.ap-southeast-1.amazonaws.com/eks/coredns:v1.8.7-eksbuild.2
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)
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
Priority Class Name: system-cluster-critical
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: coredns-8665656d55 (2/2 replicas created)
Events: <none>victorious-dusk-75271
09/06/2022, 10:52 PMvictorious-dusk-75271
09/06/2022, 11:31 PMsalmon-account-74572
09/06/2022, 11:48 PMvictorious-dusk-75271
09/06/2022, 11:54 PMvictorious-dusk-75271
09/06/2022, 11:54 PMsalmon-account-74572
09/06/2022, 11:57 PMvictorious-dusk-75271
09/07/2022, 12:28 AMvictorious-dusk-75271
09/07/2022, 12:29 AMpatchCoreDns() {
const provider = new k8s.Provider(`${this.clusterName}-k8s-provider`, {
kubeconfig: this.cluster.kubeconfig,
enableServerSideApply: true
}, { provider: this.provider })
return new k8s.apps.v1.DeploymentPatch(`${this.clusterName}-coredns-deployment-patch`, {
metadata: {
annotations: {
"pulumi.com/patchForce": "true",
},
name: 'coredns',
namespace: 'kube-system',
},
spec: {
selector: {
matchLabels: {
'eks.amazonaws.com/component': 'coredns',
'k8s-app': 'kube-dns',
}
},
template: {
spec: {
affinity: {
podAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
weight: 100,
podAffinityTerm: {
topologyKey: 'kubernetes.io/hostname',
labelSelector: {
matchExpressions: [{
key: 'k8s-app',
operator: 'In',
values: ['kube-dns']
}]
}
}
}]
}
}
}
}
}
}, { provider: provider, parent: this.cluster.provider })
}victorious-dusk-75271
09/07/2022, 12:29 AMsalmon-account-74572
09/07/2022, 12:31 AM