Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update chart with latest add-on changes #376

Merged
merged 2 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions http-add-on/templates/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: httpscaledobjects.http.keda.sh
spec:
Expand All @@ -18,9 +18,6 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.targetPendingRequests
name: TargetPendingRequests
type: integer
- jsonPath: .spec.scaleTargetRef.deploymentName
name: ScaleTargetDeploymentName
type: string
Expand Down Expand Up @@ -80,9 +77,6 @@ spec:
format: int32
type: integer
type: object
targetPendingRequests:
description: Value for the pending requests that the scaler will return to KEDA
type: integer
scaleTargetRef:
description: The name of the deployment to route HTTP requests to
(and to autoscale). Either this or Image must be set
Expand All @@ -103,6 +97,14 @@ spec:
- port
- service
type: object
scaledownPeriod:
description: (optional) Cooldown period value
format: int32
type: integer
targetPendingRequests:
description: (optional) Target metric value
format: int32
type: integer
required:
- host
- scaleTargetRef
Expand Down Expand Up @@ -158,11 +160,5 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{ end }}
{{ end }}

1 change: 1 addition & 0 deletions http-add-on/templates/deployment-interceptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
spec:
imagePullSecrets:
{{- toYaml .Values.interceptor.imagePullSecrets | nindent 8 }}
serviceAccountName: {{ .Chart.Name }}
containers:
- args:
image: "{{ .Values.images.interceptor }}:{{ .Values.images.tag | default .Chart.AppVersion }}"
Expand Down
2 changes: 1 addition & 1 deletion http-add-on/templates/deployment-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
spec:
imagePullSecrets:
{{- toYaml .Values.operator.imagePullSecrets | nindent 8 }}
serviceAccountName: {{ .Chart.Name }}
containers:
- args:
- --secure-listen-address=0.0.0.0:{{ .Values.operator.port | default 8443 }}
Expand Down Expand Up @@ -61,7 +62,6 @@ spec:
value: "{{ .Release.Namespace }}"
- name: KEDA_HTTP_OPERATOR_WATCH_NAMESPACE
value: "{{ .Values.operator.watchNamespace }}"

ports:
- containerPort: {{ .Values.operator.adminPort }}
name: admin-http
Expand Down
1 change: 1 addition & 0 deletions http-add-on/templates/deployment-scaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
spec:
imagePullSecrets:
{{- toYaml .Values.scaler.imagePullSecrets | nindent 8 }}
serviceAccountName: {{ .Chart.Name }}
containers:
- args:
image: "{{ .Values.images.scaler }}:{{ .Values.images.tag | default .Chart.AppVersion }}"
Expand Down
96 changes: 38 additions & 58 deletions http-add-on/templates/rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,18 @@ metadata:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-leader-election-role
app.kubernetes.io/name: {{ .Chart.Name }}-leader-election-role
name: {{ .Chart.Name }}-role
app.kubernetes.io/name: {{ .Chart.Name }}-role
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-leader-election-role
name: {{ .Chart.Name }}-role
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -46,19 +26,22 @@ metadata:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-manager-role
app.kubernetes.io/name: {{ .Chart.Name }}-manager-role
name: {{ .Chart.Name }}-role
app.kubernetes.io/name: {{ .Chart.Name }}-role
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-manager-role
name: {{ .Chart.Name }}-role
rules:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this introduced a spec error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this produces error 😢
Let me review it and check to cover this by test for the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get a chart v0.4.1? I could provide a PR for a release if you are not already up to it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on it, but I want to solve the CI before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question @holygrolli ,
How are you deploying the chart? I'm just trying with helm and even added again the extra line, I can't reproduce it (due to IDK how to validate it in the CI, which also uses helm)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using the GitOps approach and actually FluxCD. I first found the explanation here where I recognized the Helm chart is not correct.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey... it's complicated to reproduce during CI :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chart is already available @holygrolli , tomorrow we will announce it, but it's already available

rules:
- apiGroups:
- ""
resources:
- configmaps
- configmaps/status
- endpoint
- endpoints
- events
- pods
- services
- endpoints
- endpoint
verbs:
- create
- delete
Expand All @@ -76,17 +59,15 @@ rules:
- list
- watch
- apiGroups:
- keda.sh
- coordination.k8s.io
resources:
- scaledobjects
- leases
verbs:
- create
- delete
- get
- list
- update
- patch
- watch
- apiGroups:
- http.keda.sh
resources:
Expand All @@ -108,15 +89,17 @@ rules:
- patch
- update
- apiGroups:
- coordination.k8s.io
- keda.sh
resources:
- leases
- scaledobjects
verbs:
- get
- list
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking
resources:
Expand All @@ -131,6 +114,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
Expand All @@ -140,18 +124,14 @@ metadata:
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-proxy-role
rules:
- apiGroups:
- authentication.k8s.io
- apiGroups: ["authentication.k8s.io"]
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
verbs: ["create"]
- apiGroups: ["authorization.k8s.io"]
resources:
- subjectaccessreviews
verbs:
- create
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -177,18 +157,18 @@ metadata:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-leader-election-binding
app.kubernetes.io/name: {{ .Chart.Name }}-leader-election-binding
name: {{ .Chart.Name }}-role-binding
app.kubernetes.io/name: {{ .Chart.Name }}-role-binding
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-leader-election-rolebinding
name: {{ .Chart.Name }}-role-rolebinding
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Chart.Name }}-leader-election-role
name: {{ .Chart.Name }}-role
subjects:
- kind: ServiceAccount
name: default
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -198,17 +178,17 @@ metadata:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-manager-rolebinding
app.kubernetes.io/name: {{ .Chart.Name }}-manager-rolebinding
name: {{ .Chart.Name }}-rolebinding
app.kubernetes.io/name: {{ .Chart.Name }}-rolebinding
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-manager-rolebinding
name: {{ .Chart.Name }}-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Chart.Name }}-manager-role
name: {{ .Chart.Name }}-role
subjects:
- kind: ServiceAccount
name: default
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -218,8 +198,8 @@ metadata:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-proxy-rolebinding
app.kubernetes.io/name: {{ .Chart.Name }}-proxy-rolebinding
name: {{ .Chart.Name }}-rolebinding
app.kubernetes.io/name: {{ .Chart.Name }}-rolebinding
{{- include "keda-addons-http.labels" . | indent 4 }}
name: {{ .Chart.Name }}-proxy-rolebinding
roleRef:
Expand All @@ -228,5 +208,5 @@ roleRef:
name: {{ .Chart.Name }}-proxy-role
subjects:
- kind: ServiceAccount
name: default
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
19 changes: 14 additions & 5 deletions http-add-on/templates/routing-table-config-map.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: keda-http-routing-table
labels:
"control-plane": "operator"
"keda.sh/addon": "http-add-on"
"app": "http-add-on"
"name": "http-add-on-routing-table"
control-plane: external-scaler
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}-external-scaler
app.kubernetes.io/name: {{ .Chart.Name }}-external-scaler
app.kubernetes.io/version: {{ .Values.images.tag | default .Chart.AppVersion }}
app.kubernetes.io/component: external-scaler
app.kubernetes.io/part-of: {{ .Chart.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ tpl .Values.additionalLabels . | indent 4}}
name: keda-http-routing-table
namespace: {{ .Release.Namespace }}
data:
# this is where the operator writes the encoded routing table,
# and where the interceptor/scaler reads it
Expand Down
1 change: 1 addition & 0 deletions http-add-on/templates/scaledobject-interceptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: "{{ .Chart.Name }}-interceptor"
namespace: {{ .Release.Namespace }}
spec:
minReplicaCount: {{ .Values.interceptor.replicas.min }}
maxReplicaCount: {{ .Values.interceptor.replicas.max }}
Expand Down
16 changes: 16 additions & 0 deletions http-add-on/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
httpscaledobjects.http.keda.sh/version: {{ .Values.images.tag | default .Chart.AppVersion }}
keda.sh/addon: {{ .Chart.Name }}
app: {{ .Chart.Name }}
name: {{ .Chart.Name }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Values.images.tag | default .Chart.AppVersion }}
app.kubernetes.io/part-of: {{ .Chart.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ tpl .Values.additionalLabels . | indent 4}}
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}