How do i set priorityClass of my controller pod? #3863
Replies: 1 comment
-
Hi @darklight147, It is an interest question. In this case, you will not find a marker but you can create the PriorityClass resource and sign it to the deployment. For example, for you define a priority class for for the Deployment created by your BusyboxReconciler, you will need to first create a PriorityClass resource in Kubernetes and then reference that in your Deployment specifications under the PodTemplateSpec, such as: ...
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: ls,
},
Spec: corev1.PodSpec{
PriorityClassName: "high-my-priority-class", <- HERE add the priority
Containers: []corev1.Container{{
Image: image,
Name: "busybox",
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &corev1.SecurityContext{
RunAsNonRoot: &[]bool{true}[0],
AllowPrivilegeEscalation: &[]bool{false}[0],
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
},
}},
},
},
At the same way that we create the deployment in: You cannot forget to use the markers to grant the RBAC permissions such as we do for the deployment in: I hope that it helps. |
Beta Was this translation helpful? Give feedback.
-
Need to give my controller a higher priority Class, is there a marker for it?
Beta Was this translation helpful? Give feedback.
All reactions