Skip to content

Commit 1c58b02

Browse files
committed
wip
1 parent b4b954e commit 1c58b02

File tree

5 files changed

+311
-258
lines changed

5 files changed

+311
-258
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * assemblies/assembly-install-rhdh-aks.adoc
4+
5+
[id="proc-deploy-rhdh-instance-aks.adoc_{context}"]
6+
= Deploying the {product-short} instance on {aks-short} with the Operator
7+
8+
.Prerequisites
9+
10+
* A cluster administrator has installed the {product} Operator.
11+
* You have subscribed to `registry.redhat.io`. For more information, see https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
12+
* You have set the context to the {aks-short} cluster in your current `kubeconfig`. For more information, see https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-cli#connect-to-the-cluster[Connect to the cluster].
13+
* You have installed `kubectl`. For more information, see https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-install-cli[`az aks install-cli].
14+
15+
.Procedure
16+
17+
. Create an `ImagePull Secret` named `rhdh-pull-secret` using your Red Hat credentials to access images from the protected `registry.redhat.io` as shown in the following example:
18+
+
19+
--
20+
[source,bash]
21+
----
22+
kubectl -n <your_namespace> create secret docker-registry rhdh-pull-secret \
23+
--docker-server=registry.redhat.io \
24+
--docker-username=<redhat_user_name> \
25+
--docker-password=<redhat_password> \
26+
--docker-email=<email>
27+
----
28+
--
29+
30+
. Create an Ingress manifest file, named `rhdh-ingress.yaml`, specifying your {product-short} service name as follows:
31+
+
32+
--
33+
[source,yaml]
34+
----
35+
apiVersion: networking.k8s.io/v1
36+
kind: Ingress
37+
metadata:
38+
name: rhdh-ingress
39+
namespace: <your_namespace>
40+
spec:
41+
ingressClassName: webapprouting.kubernetes.azure.com
42+
rules:
43+
- http:
44+
paths:
45+
- path: /
46+
pathType: Prefix
47+
backend:
48+
service:
49+
name: backstage-<your-CR-name>
50+
port:
51+
name: http-backend
52+
----
53+
--
54+
55+
. To deploy the created Ingress, run the following command:
56+
+
57+
--
58+
[source,terminal]
59+
----
60+
kubectl -n <your_namespace> apply -f rhdh-ingress.yaml
61+
----
62+
--
63+
64+
. Create a ConfigMap named `app-config-rhdh` containing the {product-short} configuration using the following example:
65+
+
66+
--
67+
[source,yaml]
68+
----
69+
apiVersion: v1
70+
kind: ConfigMap
71+
metadata:
72+
name: app-config-rhdh
73+
data:
74+
"app-config-rhdh.yaml": |
75+
app:
76+
title: Red Hat Developer Hub
77+
baseUrl: https://<app_address>
78+
backend:
79+
auth:
80+
externalAccess:
81+
- type: legacy
82+
options:
83+
subject: legacy-default-config
84+
secret: "${BACKEND_SECRET}"
85+
baseUrl: https://<app_address>
86+
cors:
87+
origin: https://<app_address>
88+
----
89+
--
90+
91+
. Create a Secret named `secrets-rhdh` and add a key named `BACKEND_SECRET` with a `Base64-encoded` string value as shown in the following example:
92+
+
93+
--
94+
[source,yaml]
95+
----
96+
apiVersion: v1
97+
kind: Secret
98+
metadata:
99+
name: secrets-rhdh
100+
stringData:
101+
BACKEND_SECRET: "xxx"
102+
----
103+
--
104+
105+
. Create a Custom Resource (CR) manifest file named `rhdh.yaml` and include the previously created `rhdh-pull-secret` as follows:
106+
+
107+
--
108+
[source,yaml]
109+
----
110+
apiVersion: rhdh.redhat.com/v1alpha1
111+
kind: Backstage
112+
metadata:
113+
name: <your-rhdh-cr>
114+
spec:
115+
application:
116+
imagePullSecrets:
117+
- rhdh-pull-secret
118+
appConfig:
119+
configMaps:
120+
- name: "app-config-rhdh"
121+
extraEnvs:
122+
secrets:
123+
- name: "secrets-rhdh"
124+
----
125+
--
126+
127+
. Apply the CR manifest to your namespace:
128+
+
129+
--
130+
[source,terminal]
131+
----
132+
kubectl -n <your_namespace> apply -f rhdh.yaml
133+
----
134+
--
135+
136+
.Verification
137+
138+
Access the deployed {product-short} using the URL: `https://<app_address>`, where <app_address> is the Ingress address obtained earlier (for example, `https://108.141.70.228`).
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2+
3+
. Run the following command in your terminal to create the `rhdh-operator` namespace where the Operator is installed:
4+
+
5+
--
6+
[source,terminal]
7+
----
8+
kubectl create namespace rhdh-operator
9+
----
10+
--
11+
12+
. Create a pull secret in the `olm` namespace using the following command:
13+
+
14+
--
15+
[source,terminal]
16+
----
17+
kubectl -n olm create secret docker-registry rhdh-pull-secret \
18+
--docker-server=registry.redhat.io \
19+
--docker-username=<user_name> \ <1>
20+
--docker-password=<password> \ <2>
21+
--docker-email=<email> <3>
22+
----
23+
24+
<1> Enter your username in the command.
25+
<2> Enter your password in the command.
26+
<3> Enter your email address in the command.
27+
28+
The created pull secret is used to pull the Operator images from the {company-name} Ecosystem.
29+
--
30+
31+
. Create a `CatalogSource` resource in the `olm` namespace that contains the Operators from the {company-name} Ecosystem:
32+
+
33+
--
34+
[source,terminal,subs="attributes+"]
35+
----
36+
cat <<EOF | kubectl -n olm apply -f -
37+
apiVersion: operators.coreos.com/v1alpha1
38+
kind: CatalogSource
39+
metadata:
40+
name: redhat-catalog
41+
spec:
42+
sourceType: grpc
43+
image: registry.redhat.io/redhat/redhat-operator-index:v{ocp-version}
44+
secrets:
45+
- "rhdh-pull-secret"
46+
displayName: {company-name} Operators
47+
EOF
48+
----
49+
--
50+
51+
. Wait a few minutes until the Catalog Source is up and run the following command to list the available operators from the {company-name} ecosystem and confirm that the `rhdh` operator is listed:
52+
+
53+
--
54+
[source,terminal,subs="attributes+"]
55+
----
56+
kubectl -n olm get packagemanifests
57+
----
58+
--
59+
60+
. Create a pull secret in the `rhdh-operator` namespace using the following command:
61+
+
62+
--
63+
[source,terminal]
64+
----
65+
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \
66+
--docker-server=registry.redhat.io \
67+
--docker-username=<user_name> \ <1>
68+
--docker-password=<password> \ <2>
69+
--docker-email=<email> <3>
70+
----
71+
72+
<1> Enter your username in the command.
73+
<2> Enter your password in the command.
74+
<3> Enter your email address in the command.
75+
76+
The created pull secret is used to pull the {product-short} images from the {company-name} Ecosystem.
77+
--
78+
79+
. Create an `OperatorGroup` resource as follows:
80+
+
81+
--
82+
[source,terminal]
83+
----
84+
cat <<EOF | kubectl apply -n rhdh-operator -f -
85+
apiVersion: operators.coreos.com/v1
86+
kind: OperatorGroup
87+
metadata:
88+
name: rhdh-operator-group
89+
EOF
90+
----
91+
--
92+
93+
. Create a `Subscription` resource using the following code:
94+
+
95+
--
96+
[source,terminal,subs="attributes+"]
97+
----
98+
cat <<EOF | kubectl apply -n rhdh-operator -f -
99+
apiVersion: operators.coreos.com/v1alpha1
100+
kind: Subscription
101+
metadata:
102+
name: rhdh
103+
namespace: rhdh-operator
104+
spec:
105+
channel: fast
106+
installPlanApproval: Automatic
107+
name: rhdh
108+
source: redhat-catalog
109+
sourceNamespace: olm
110+
startingCSV: rhdh-operator.v{product-bundle-version}
111+
EOF
112+
----
113+
--
114+
115+
. Run the following command to verify that the created Operator is running:
116+
+
117+
--
118+
[source,terminal]
119+
----
120+
kubectl -n rhdh-operator get pods -w
121+
----
122+
123+
If the operator pod shows `ImagePullBackOff` status, then you might need permissions to pull the image directly within the Operator deployment's manifest.
124+
125+
[TIP]
126+
====
127+
You can include the required secret name in the `deployment.spec.template.spec.imagePullSecrets` list and verify the deployment name using `kubectl get deployment -n rhdh-operator` command:
128+
129+
[source,terminal]
130+
----
131+
kubectl -n rhdh-operator patch deployment \
132+
rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \
133+
--type=merge
134+
----
135+
====
136+
--
137+
138+
. Update the default configuration of the operator to ensure that {product-short} resources can start correctly using the following steps:
139+
.. Edit the `backstage-default-config` ConfigMap in the `rhdh-operator` namespace using the following command:
140+
+
141+
--
142+
[source,terminal]
143+
----
144+
kubectl -n rhdh-operator edit configmap backstage-default-config
145+
----
146+
--

0 commit comments

Comments
 (0)