Skip to content

Commit 60038b3

Browse files
committed
wip
1 parent b4b954e commit 60038b3

File tree

5 files changed

+313
-258
lines changed

5 files changed

+313
-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: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
// Included in the following procedures
2+
// proc-rhdh-deploy-aks-operator.adoc
3+
// proc-rhdh-deploy-eks-operator.adoc
4+
5+
. Create a pull secret in the `olm` namespace using the following command:
6+
+
7+
--
8+
[source,terminal]
9+
----
10+
kubectl -n olm create secret docker-registry rhdh-pull-secret \
11+
--docker-server=registry.redhat.io \
12+
--docker-username=<user_name> \ <1>
13+
--docker-password=<password> \ <2>
14+
--docker-email=<email> <3>
15+
----
16+
17+
<1> Enter your username in the command.
18+
<2> Enter your password in the command.
19+
<3> Enter your email address in the command.
20+
21+
The created pull secret is used to pull the Operator images from the {company-name} Ecosystem.
22+
--
23+
24+
. Create a `CatalogSource` resource in the `olm` namespace that contains the Operators from the {company-name} Ecosystem:
25+
+
26+
--
27+
[source,terminal,subs="attributes+"]
28+
----
29+
cat <<EOF | kubectl -n olm apply -f -
30+
apiVersion: operators.coreos.com/v1alpha1
31+
kind: CatalogSource
32+
metadata:
33+
name: redhat-catalog
34+
spec:
35+
sourceType: grpc
36+
image: registry.redhat.io/redhat/redhat-operator-index:v{ocp-version}
37+
secrets:
38+
- "rhdh-pull-secret"
39+
displayName: {company-name} Operators
40+
EOF
41+
----
42+
--
43+
44+
. 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:
45+
+
46+
--
47+
[source,terminal,subs="attributes+"]
48+
----
49+
kubectl -n olm get packagemanifests
50+
----
51+
--
52+
53+
. Run the following command in your terminal to create the `rhdh-operator` namespace where the Operator is installed:
54+
+
55+
--
56+
[source,terminal]
57+
----
58+
kubectl create namespace rhdh-operator
59+
----
60+
--
61+
62+
. Create a pull secret in the `rhdh-operator` namespace using the following command:
63+
+
64+
--
65+
[source,terminal]
66+
----
67+
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \
68+
--docker-server=registry.redhat.io \
69+
--docker-username=<user_name> \ <1>
70+
--docker-password=<password> \ <2>
71+
--docker-email=<email> <3>
72+
----
73+
74+
<1> Enter your username in the command.
75+
<2> Enter your password in the command.
76+
<3> Enter your email address in the command.
77+
78+
The created pull secret is used to pull the {product-short} images from the {company-name} Ecosystem.
79+
--
80+
81+
. Create an `OperatorGroup` resource as follows:
82+
+
83+
--
84+
[source,terminal]
85+
----
86+
cat <<EOF | kubectl apply -n rhdh-operator -f -
87+
apiVersion: operators.coreos.com/v1
88+
kind: OperatorGroup
89+
metadata:
90+
name: rhdh-operator-group
91+
EOF
92+
----
93+
--
94+
95+
. Create a `Subscription` resource using the following code:
96+
+
97+
--
98+
[source,terminal,subs="attributes+"]
99+
----
100+
cat <<EOF | kubectl apply -n rhdh-operator -f -
101+
apiVersion: operators.coreos.com/v1alpha1
102+
kind: Subscription
103+
metadata:
104+
name: rhdh
105+
namespace: rhdh-operator
106+
spec:
107+
channel: fast
108+
installPlanApproval: Automatic
109+
name: rhdh
110+
source: redhat-catalog
111+
sourceNamespace: olm
112+
startingCSV: rhdh-operator.v{product-bundle-version}
113+
EOF
114+
----
115+
--
116+
117+
. Run the following command to verify that the created Operator is running:
118+
+
119+
--
120+
[source,terminal]
121+
----
122+
kubectl -n rhdh-operator get pods -w
123+
----
124+
125+
If the operator pod shows `ImagePullBackOff` status, then you might need permissions to pull the image directly within the Operator deployment's manifest.
126+
127+
[TIP]
128+
====
129+
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:
130+
131+
[source,terminal]
132+
----
133+
kubectl -n rhdh-operator patch deployment \
134+
rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \
135+
--type=merge
136+
----
137+
====
138+
--
139+
140+
. Update the default configuration of the operator to ensure that {product-short} resources can start correctly using the following steps:
141+
.. Edit the `backstage-default-config` ConfigMap in the `rhdh-operator` namespace using the following command:
142+
+
143+
--
144+
[source,terminal]
145+
----
146+
kubectl -n rhdh-operator edit configmap backstage-default-config
147+
----
148+
--

0 commit comments

Comments
 (0)