Skip to content

Commit afd0298

Browse files
committed
OCPBUGS-38430: Adding missing step to Autoscaling an Ingress Controller
1 parent 4177146 commit afd0298

File tree

3 files changed

+40
-42
lines changed

3 files changed

+40
-42
lines changed

_attributes/attributes-openshift-dedicated.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:OCP-short: OpenShift
99
:ocp-version: 4.14
1010
:op-system-first: Red Hat Enterprise Linux CoreOS (RHCOS)
11+
:oc-first: pass:quotes[OpenShift CLI (`oc`)]
1112
:cluster-manager-first: Red Hat OpenShift Cluster Manager
1213
:cluster-manager: OpenShift Cluster Manager
1314
:cluster-manager-url: link:https://console.redhat.com/openshift[OpenShift Cluster Manager]

modules/nw-autoscaling-ingress-controller.adoc

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
// Module included in the following assemblies:
22
//
3-
// * networking/ingress-controller-configuration.adoc
3+
// * networking/ingress-operator.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="nw-autoscaling-ingress-controller_{context}"]
77
= Autoscaling an Ingress Controller
88

9-
Automatically scale an Ingress Controller to dynamically meet routing performance or availability requirements such as the requirement to increase throughput. The following procedure provides an example for scaling up the default `IngressController`.
9+
You can automatically scale an Ingress Controller to dynamically meet routing performance or availability requirements, such as the requirement to increase throughput.
10+
11+
The following procedure provides an example for scaling up the default Ingress Controller.
1012

1113
.Prerequisites
12-
. You have the OpenShift CLI (`oc`) installed.
13-
. You have access to an {product-title} cluster as a user with the `cluster-admin` role.
14-
. You have the Custom Metrics Autoscaler Operator installed.
15-
. You are in the `openshift-ingress-operator` project namespace.
14+
15+
* You have the {oc-first} installed.
16+
* You have access to an {product-title} cluster as a user with the `cluster-admin` role.
17+
* You installed the Custom Metrics Autoscaler Operator and an associated KEDA Controller.
18+
** You can install the Operator by using OperatorHub on the web console. After you install the Operator, you can create an instance of `KedaController`.
1619
1720
.Procedure
1821

1922
. Create a service account to authenticate with Thanos by running the following command:
2023
+
2124
[source,terminal]
2225
----
23-
$ oc create serviceaccount thanos && oc describe serviceaccount thanos
26+
$ oc create -n openshift-ingress-operator serviceaccount thanos && oc describe -n openshift-ingress-operator serviceaccount thanos
2427
----
2528
+
2629
.Example output
@@ -30,9 +33,9 @@ Name: thanos
3033
Namespace: openshift-ingress-operator
3134
Labels: <none>
3235
Annotations: <none>
33-
Image pull secrets: thanos-dockercfg-b4l9s
34-
Mountable secrets: thanos-dockercfg-b4l9s
35-
Tokens: thanos-token-c422q
36+
Image pull secrets: thanos-dockercfg-kfvf2
37+
Mountable secrets: thanos-dockercfg-kfvf2
38+
Tokens: <none>
3639
Events: <none>
3740
----
3841

@@ -45,43 +48,33 @@ apiVersion: v1
4548
kind: Secret
4649
metadata:
4750
name: thanos-token
51+
namespace: openshift-ingress-operator
4852
annotations:
4953
kubernetes.io/service-account.name: thanos
50-
type: kubernetes.io/service-account-token
54+
type: kubernetes.io/service-account-token
5155
EOF
5256
----
5357

54-
. Define a `TriggerAuthentication` object within the `openshift-ingress-operator` namespace using the service account's token.
55-
56-
.. Define the variable `secret` that contains the secret by running the following command:
57-
+
58-
[source,terminal]
59-
----
60-
$ secret=$(oc get secret | grep thanos-token | head -n 1 | awk '{ print $1 }')
61-
----
58+
. Define a `TriggerAuthentication` object within the `openshift-ingress-operator` namespace by using the service account's token.
6259

6360
.. Create the `TriggerAuthentication` object and pass the value of the `secret` variable to the `TOKEN` parameter:
6461
+
6562
[source,terminal]
6663
----
67-
$ oc process TOKEN="$secret" -f - <<EOF | oc apply -f -
68-
apiVersion: template.openshift.io/v1
69-
kind: Template
70-
parameters:
71-
- name: TOKEN
72-
objects:
73-
- apiVersion: keda.sh/v1alpha1
74-
kind: TriggerAuthentication
75-
metadata:
76-
name: keda-trigger-auth-prometheus
77-
spec:
78-
secretTargetRef:
79-
- parameter: bearerToken
80-
name: \${TOKEN}
81-
key: token
82-
- parameter: ca
83-
name: \${TOKEN}
84-
key: ca.crt
64+
$ oc apply -f - <<EOF
65+
apiVersion: keda.sh/v1alpha1
66+
kind: TriggerAuthentication
67+
metadata:
68+
name: keda-trigger-auth-prometheus
69+
namespace: openshift-ingress-operator
70+
spec:
71+
secretTargetRef:
72+
- parameter: bearerToken
73+
name: thanos-token
74+
key: token
75+
- parameter: ca
76+
name: thanos-token
77+
key: ca.crt
8578
EOF
8679
----
8780

@@ -96,6 +89,7 @@ apiVersion: rbac.authorization.k8s.io/v1
9689
kind: Role
9790
metadata:
9891
name: thanos-metrics-reader
92+
namespace: openshift-ingress-operator
9993
rules:
10094
- apiGroups:
10195
- ""
@@ -132,7 +126,7 @@ $ oc apply -f thanos-metrics-reader.yaml
132126
+
133127
[source,terminal]
134128
----
135-
$ oc adm policy add-role-to-user thanos-metrics-reader -z thanos --role-namespace=openshift-ingress-operator
129+
$ oc adm policy -n openshift-ingress-operator add-role-to-user thanos-metrics-reader -z thanos --role-namespace=openshift-ingress-operator
136130
----
137131
+
138132
[source,terminal]
@@ -154,6 +148,7 @@ apiVersion: keda.sh/v1alpha1
154148
kind: ScaledObject
155149
metadata:
156150
name: ingress-scaler
151+
namespace: openshift-ingress-operator
157152
spec:
158153
scaleTargetRef: <1>
159154
apiVersion: operator.openshift.io/v1
@@ -202,13 +197,13 @@ $ oc apply -f ingress-autoscaler.yaml
202197
+
203198
[source,terminal]
204199
----
205-
$ oc get ingresscontroller/default -o yaml | grep replicas:
200+
$ oc get -n openshift-ingress-operator ingresscontroller/default -o yaml | grep replicas:
206201
----
207202
+
208203
.Example output
209204
[source,terminal]
210205
----
211-
replicas: 3
206+
replicas: 3
212207
----
213208

214209
** Get the pods in the `openshift-ingress` project:

networking/ingress-operator.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ include::modules/nw-ingress-setting-a-custom-default-certificate.adoc[leveloffse
5050

5151
include::modules/nw-ingress-custom-default-certificate-remove.adoc[leveloffset=+2]
5252

53+
// Autoscaling an Ingress Controller
5354
include::modules/nw-autoscaling-ingress-controller.adoc[leveloffset=+2]
5455

5556
ifndef::openshift-rosa,openshift-dedicated[]
5657
[role="_additional-resources"]
5758
.Additional resources
58-
* xref:../observability/monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects_enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
5959

60-
* xref:../nodes/cma/nodes-cma-autoscaling-custom-install.adoc#nodes-cma-autoscaling-custom-install[Installing the custom metrics autoscaler]
60+
* xref:../nodes/cma/nodes-cma-autoscaling-custom-install.adoc#nodes-cma-autoscaling-custom-install_nodes-cma-autoscaling-custom-install[Installing the custom metrics autoscaler]
61+
62+
* xref:../observability/monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects_enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
6163

6264
* xref:../nodes/cma/nodes-cma-autoscaling-custom-trigger-auth.adoc#nodes-cma-autoscaling-custom-trigger-auth[Understanding custom metrics autoscaler trigger authentications]
6365

0 commit comments

Comments
 (0)