diff --git a/http-add-on/templates/crd.yaml b/http-add-on/templates/crd.yaml index 9c64f00c..cfb2ef56 100644 --- a/http-add-on/templates/crd.yaml +++ b/http-add-on/templates/crd.yaml @@ -93,8 +93,9 @@ spec: type: integer type: object scaleTargetRef: - description: The name of the deployment to route HTTP requests to - (and to autoscale). + description: |- + The name of the deployment to route HTTP requests to (and to autoscale). + Including validation as a requirement to define either the PortName or the Port properties: apiVersion: type: string @@ -110,13 +111,18 @@ spec: description: The port to route to format: int32 type: integer + portName: + description: The port to route to referenced by name + type: string service: description: The name of the service to route to type: string required: - - port - service type: object + x-kubernetes-validations: + - message: must define either the 'portName' or the 'port' + rule: has(self.portName) != has(self.port) scaledownPeriod: description: (optional) Cooldown period value format: int32 @@ -152,7 +158,7 @@ spec: type: object type: object targetPendingRequests: - description: (optional) DEPRECATED (use SscalingMetric instead) Target + description: (optional) DEPRECATED (use ScalingMetric instead) Target metric value format: int32 type: integer @@ -210,4 +216,3 @@ spec: subresources: status: {} {{ end }} - \ No newline at end of file diff --git a/http-add-on/templates/interceptor/rbac.yml b/http-add-on/templates/interceptor/rbac.yml index 4b3b6a30..44e69298 100644 --- a/http-add-on/templates/interceptor/rbac.yml +++ b/http-add-on/templates/interceptor/rbac.yml @@ -16,6 +16,14 @@ rules: - get - list - watch +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch - apiGroups: - http.keda.sh resources: