Skip to content

Commit

Permalink
update for the new HPA v2 (v2beta2 has been deprecated and removed in…
Browse files Browse the repository at this point in the history
… newer kubernetes) (#536)

part of: kiali/kiali#5022
  • Loading branch information
jmazzitelli committed May 16, 2022
1 parent 2d908fb commit 128210e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
10 changes: 8 additions & 2 deletions crd-docs/cr/kiali.io_v1alpha1_kiali.yaml
Expand Up @@ -102,12 +102,18 @@ spec:
mount: "/a-custom-secret-path"
optional: true
hpa:
api_version: "autoscaling/v2beta2"
api_version: "autoscaling/v2"
# default: spec is empty
spec:
maxReplicas: 2
minReplicas: 1
targetCPUUtilizationPercentage: 80
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
# default: host_aliases is an empty list
host_aliases:
- ip: "192.168.1.100"
Expand Down
12 changes: 9 additions & 3 deletions crd-docs/crd/kiali.io_kialis.yaml
Expand Up @@ -276,11 +276,17 @@ spec:
A typical way to configure HPA for Kiali is,
```
hpa:
api_version: "autoscaling/v2beta2"
api_version: "autoscaling/v2"
spec:
maxReplicas: 2
minReplicas: 1
targetCPUUtilizationPercentage: 80
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
```
type: object
properties:
Expand Down Expand Up @@ -394,7 +400,7 @@ spec:
backend:
service
name: "kiali"
port:
port:
number: 20001
```
type: object
Expand Down
6 changes: 3 additions & 3 deletions molecule/affinity-tolerations-resources-test/converge.yml
Expand Up @@ -64,7 +64,7 @@
new_pod_labels:
some.test.label/labelKeepCamelCaseFOO: labelCamelCaseValueFOO
new_hpa:
api_version: autoscaling/v1
api_version: autoscaling/v2
spec:
minReplicas: 1
maxReplicas: 1
Expand Down Expand Up @@ -123,7 +123,7 @@

- name: Get the HPA resource that should now exist
k8s_info:
api_version: autoscaling/v1
api_version: autoscaling/v2
kind: HorizontalPodAutoscaler
namespace: "{{ kiali.install_namespace }}"
name: kiali
Expand Down Expand Up @@ -174,7 +174,7 @@

- name: Try to obtain the HPA which should have been removed
k8s_info:
api_version: autoscaling/v1
api_version: autoscaling/v2
kind: HorizontalPodAutoscaler
namespace: "{{ kiali.install_namespace }}"
name: kiali
Expand Down
2 changes: 1 addition & 1 deletion roles/default/kiali-deploy/defaults/main.yml
Expand Up @@ -61,7 +61,7 @@ kiali_defaults:
custom_secrets: []
host_aliases: []
hpa:
api_version: "autoscaling/v2beta2"
api_version: "autoscaling/v2"
spec: {}
image_digest: ""
image_name: ""
Expand Down
2 changes: 1 addition & 1 deletion roles/default/kiali-remove/defaults/main.yml
Expand Up @@ -4,7 +4,7 @@ kiali_defaults:
deployment:
accessible_namespaces: []
hpa:
api_version: "autoscaling/v2beta2"
api_version: "autoscaling/v2"
instance_name: "kiali"

# Will be auto-detected, but for debugging purposes you can force one of these to true
Expand Down

0 comments on commit 128210e

Please sign in to comment.