@@ -13,88 +13,6 @@ E0214 11:30:09.556332 1 main.go:266] Error while autoscaling: failed to ge
1313And see that your autoscaler is not scaling the target resource if you are targeting a custom resource.
1414
1515This is because your autoscaler does not have the correct permissions to manage the resource you are
16- targeting. By default the [ Custom Pod Autoscaler
17- Operator] ( https://github.com/jthomperoo/custom-pod-autoscaler-operator ) will provision a role for your autoscaler
18- which allows managing the built-in Kubernetes resources (deployments, replicasets, statefulsets,
19- replicationcontrollers), but if you are targeting a custom resource you need to provide your own role with the
20- correct permissions.
16+ targeting.
2117
22- You need to tell the operator not to provision a role for you, and provide your own with the permissions needed,
23- for example to target Loadstash:
24-
25- ``` yaml
26- apiVersion : rbac.authorization.k8s.io/v1
27- kind : Role
28- metadata :
29- name : python-custom-autoscaler
30- rules :
31- - apiGroups :
32- - logstash.k8s.elastic.co
33- resources :
34- - logstashes
35- - logstashes/scale
36- verbs :
37- - ' *'
38- ---
39- apiVersion : v1
40- kind : ServiceAccount
41- metadata :
42- name : python-custom-autoscaler
43- ---
44- kind : RoleBinding
45- apiVersion : rbac.authorization.k8s.io/v1
46- metadata :
47- name : python-custom-autoscaler
48- subjects :
49- - kind : ServiceAccount
50- name : python-custom-autoscaler
51- roleRef :
52- kind : Role
53- name : python-custom-autoscaler
54- apiGroup : rbac.authorization.k8s.io
55- ---
56- apiVersion : custompodautoscaler.com/v1
57- kind : CustomPodAutoscaler
58- metadata :
59- name : python-custom-autoscaler
60- spec :
61- template :
62- spec :
63- serviceAccountName : python-custom-autoscaler
64- containers :
65- - name : python-custom-autoscaler
66- image : python-custom-autoscaler:latest
67- imagePullPolicy : IfNotPresent
68- scaleTargetRef :
69- apiVersion : logstash.k8s.elastic.co/v1alpha1
70- kind : Logstash
71- name : quickstart
72- provisionRole : false
73- provisionRoleBinding : false
74- provisionServiceAccount : false
75- config :
76- - name : interval
77- value : " 10000"
78- ` ` `
79-
80- This takes over provisioning of the role, the role binding, and the service account from the operator.
81-
82- For any custom resource the CPO can support scaling it if the resource implements the scale subresource, and if so
83- the permissions needed are generally:
84-
85- ` ` ` yaml
86- - apiGroups :
87- - my.api.group
88- resources :
89- - mycustomresource
90- - mycustomresource/scale
91- verbs :
92- - ' *'
93- ` ` `
94-
95- There is a special case for [Argo Rollouts](https://argoproj.github.io/rollouts/), which can simply provide the
96- ` roleRequiresArgoRollouts` field. [See more information
97- here](https://github.com/jthomperoo/custom-pod-autoscaler-operator/blob/v1.4.2/USAGE.md#automatically-provisioning-a-role-that-supports-argo-rollouts).
98-
99- [See how to skip automatic role/any other resource provision
100- here](https://github.com/jthomperoo/custom-pod-autoscaler-operator/blob/v1.4.2/USAGE.md#using-custom-resources).
18+ See [ the Custom Resources page for details on how to resolve this] ( ./custom-resources.md ) .
0 commit comments