victorious-dusk-75271
09/06/2022, 10:17 PM@pulumi/eks
?salmon-account-74572
09/06/2022, 10:36 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: {
"<http://pulumi.com/patchForce|pulumi.com/patchForce>": "true",
},
name: 'coredns',
},
spec: {
template: {
spec: {
affinity: {
podAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
weight: 100,
podAffinityTerm: {
topologyKey: '<http://kubernetes.io/hostname|kubernetes.io/hostname>',
labelSelector: {
matchExpressions: [{
key: 'k8s-app',
operator: 'In',
values: ['kube-dns']
}]
}
}
}]
}
}
}
}
}
}, { provider: provider, parent: this.cluster.provider })
error: 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: <http://eks.amazonaws.com/component=coredns|eks.amazonaws.com/component=coredns>
k8s-app=kube-dns
<http://kubernetes.io/name=CoreDNS|kubernetes.io/name=CoreDNS>
Annotations: <http://deployment.kubernetes.io/revision|deployment.kubernetes.io/revision>: 3
Selector: <http://eks.amazonaws.com/component=coredns,k8s-app=kube-dns|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: <http://eks.amazonaws.com/component=coredns|eks.amazonaws.com/component=coredns>
k8s-app=kube-dns
Annotations: <http://eks.amazonaws.com/compute-type|eks.amazonaws.com/compute-type>: ec2
<http://kubectl.kubernetes.io/restartedAt|kubectl.kubernetes.io/restartedAt>: 2022-09-07T02:02:37+06:00
Service Account: coredns
Containers:
coredns:
Image: <http://602401143452.dkr.ecr.ap-southeast-1.amazonaws.com/eks/coredns:v1.8.7-eksbuild.2|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>
salmon-account-74572
09/06/2022, 11:48 PMvictorious-dusk-75271
09/06/2022, 11:54 PMsalmon-account-74572
09/06/2022, 11:57 PMvictorious-dusk-75271
09/07/2022, 12:28 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: {
"<http://pulumi.com/patchForce|pulumi.com/patchForce>": "true",
},
name: 'coredns',
namespace: 'kube-system',
},
spec: {
selector: {
matchLabels: {
'<http://eks.amazonaws.com/component|eks.amazonaws.com/component>': 'coredns',
'k8s-app': 'kube-dns',
}
},
template: {
spec: {
affinity: {
podAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
weight: 100,
podAffinityTerm: {
topologyKey: '<http://kubernetes.io/hostname|kubernetes.io/hostname>',
labelSelector: {
matchExpressions: [{
key: 'k8s-app',
operator: 'In',
values: ['kube-dns']
}]
}
}
}]
}
}
}
}
}
}, { provider: provider, parent: this.cluster.provider })
}
salmon-account-74572
09/07/2022, 12:31 AM