diff --git a/docs/qos.md b/docs/qos.md index 6e068762651..902675249e0 100644 --- a/docs/qos.md +++ b/docs/qos.md @@ -40,7 +40,7 @@ spec: type: object properties: priority: - type: string # Value in range 0 to 4,294,967,295. + type: string # Value in range 0 to 7. scope: Cluster names: plural: htbqoses @@ -54,9 +54,9 @@ The spec parameter has only one field, `htbqoses.spec.priority`, which value rep ``` mac@bogon kube-ovn % kubectl get htbqos NAME PRIORITY -htbqos-high 100 -htbqos-low 300 -htbqos-medium 200 +htbqos-high 1 +htbqos-low 5 +htbqos-medium 3 ``` Specific priority values are unimportant, only relative ordering matters. The smaller the priority value, the higher the QoS priority. diff --git a/pkg/controller/init.go b/pkg/controller/init.go index cab88ad00e9..1beef1fc849 100644 --- a/pkg/controller/init.go +++ b/pkg/controller/init.go @@ -743,11 +743,11 @@ func (c *Controller) initHtbQos() error { switch qosName { case util.HtbQosHigh: - priority = "100" + priority = "1" case util.HtbQosMedium: - priority = "200" + priority = "3" case util.HtbQosLow: - priority = "300" + priority = "5" default: klog.Errorf("qos %s is not default defined", qosName) } diff --git a/test/e2e/qos/qos.go b/test/e2e/qos/qos.go index 0297d133c6b..2f9f1d45177 100644 --- a/test/e2e/qos/qos.go +++ b/test/e2e/qos/qos.go @@ -231,7 +231,7 @@ var _ = Describe("[Qos]", func() { Spec: kubeovn.SubnetSpec{ CIDRBlock: cidr, Protocol: util.CheckProtocol(cidr), - HtbQos: util.HtbQosHigh, + HtbQos: util.HtbQosLow, Namespaces: []string{namespace}, }, } @@ -243,7 +243,7 @@ var _ = Describe("[Qos]", func() { subnet, err := f.OvnClientSet.KubeovnV1().Subnets().Get(context.Background(), name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) - Expect(subnet.Spec.HtbQos).To(Equal(util.HtbQosHigh)) + Expect(subnet.Spec.HtbQos).To(Equal(util.HtbQosLow)) autoMount := false oriPod := &corev1.Pod{ @@ -282,11 +282,11 @@ var _ = Describe("[Qos]", func() { time.Sleep(3 * time.Second) priority, _, err := framework.GetPodHtbQosPara(name, namespace) Expect(err).NotTo(HaveOccurred()) - Expect(priority).To(Equal("100")) + Expect(priority).To(Equal("5")) By("Annotate pod with priority") pod := oriPod.DeepCopy() - pod.Annotations[util.PriorityAnnotation] = "60" + pod.Annotations[util.PriorityAnnotation] = "2" patch, err := util.GenerateStrategicMergePatchPayload(oriPod, pod) Expect(err).NotTo(HaveOccurred()) @@ -296,13 +296,13 @@ var _ = Describe("[Qos]", func() { pod, err = f.KubeClientSet.CoreV1().Pods(namespace).Get(context.Background(), name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) - Expect(pod.Annotations[util.PriorityAnnotation]).To(Equal("60")) + Expect(pod.Annotations[util.PriorityAnnotation]).To(Equal("2")) By("Check Ovs Qos Para") time.Sleep(3 * time.Second) priority, _, err = framework.GetPodHtbQosPara(name, namespace) Expect(err).NotTo(HaveOccurred()) - Expect(priority).To(Equal("60")) + Expect(priority).To(Equal("2")) By("Delete Pod priority annotation") testPod := pod.DeepCopy() @@ -321,7 +321,7 @@ var _ = Describe("[Qos]", func() { time.Sleep(3 * time.Second) priority, _, err = framework.GetPodHtbQosPara(name, namespace) Expect(err).NotTo(HaveOccurred()) - Expect(priority).To(Equal("100")) + Expect(priority).To(Equal("5")) By("Delete pod") err = f.KubeClientSet.CoreV1().Pods(namespace).Delete(context.Background(), pod.Name, metav1.DeleteOptions{})