helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Horizontal Pod Autoscaler

Open TheDarkula opened this issue 10 months ago • 1 comments

I am not certain if this is something that is not currently implemented, or if I do not know which section to place it in, but I see no example of using a HorizontalPodAutoscaler as mentioned here.

I thought I would be able to add something like this to a controller:

replicas: null
autoScaling:
  horizontal:
    minReplicas: 1
    maxReplicas: 10

Is there an example somewhere I am missing?

TheDarkula avatar Apr 14 '24 08:04 TheDarkula

This could be solved by https://github.com/bjw-s/helm-charts/issues/314 ?

onedr0p avatar Apr 15 '24 14:04 onedr0p

@bjw-s Thank you so much for the 3.3.0 update!

I just tested out this block:

  rawResources:
    ingressroutetcp-listener-tcp:
      enabled: true
      apiVersion: traefik.io/v1alpha1
      kind: IngressRouteTCP
      spec:
        entryPoints:
          - st-listener-tcp
        routes:
        - match: HostSNI(`*`)
          services:
          - name: syncthing
            port: 22000
            weight: 10

Unfortunately, it seems that there is something wrong with the spec: block parsing:

W0729 17:24:12.001692 1038775 warnings.go:70] unknown field "entryPoints"
W0729 17:24:12.001720 1038775 warnings.go:70] unknown field "routes"
upgrade.go:468: [debug] warning: Upgrade "syncthing" failed: failed to create resource: IngressRouteTCP.traefik.io "syncthing-ingressroutetcp-listener-tcp" is invalid: spec: Required value
Error: UPGRADE FAILED: failed to create resource: IngressRouteTCP.traefik.io "syncthing-ingressroutetcp-listener-tcp" is invalid: spec: Required value
helm.go:84: [debug] IngressRouteTCP.traefik.io "syncthing-ingressroutetcp-listener-tcp" is invalid: spec: Required value
failed to create resource

This plain yaml file functions properly, for comparison:

apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
  name: syncthing-ingressroutetcp-listener-tcp
  namespace: syncthing

spec:
  entryPoints:
    - st-listener-tcp
  routes:
  - match: HostSNI(`*`)
    services:
    - name: syncthing
      port: 22000
      weight: 10

TheDarkula avatar Jul 29 '24 17:07 TheDarkula

Hi, thanks for the feedback! As you can see in this example (https://github.com/bjw-s/helm-charts/blob/main/charts/library/common-test/ci/advanced-values.yaml#L105-L107) you will need to put the entire "spec" under the spec key. I can see how that can seem a bit counter-intuitive at first. I ended up doing it like that because some CRD's don't have a root level spec key but something completely different.

bjw-s avatar Jul 29 '24 17:07 bjw-s

@bjw-s Absolutely!
 
Ah, the wonderful world of inconsistencies :)

 That sorted it, thank you!

TheDarkula avatar Jul 29 '24 20:07 TheDarkula