ããã«ã¡ã¯ãRed Hatã§OpenShifté¢é£ã®ããªã»ã¼ã«ã¹ããã¦ããåæã§ãã
ä»åãã "Developer Hub å®è·µ" ã¨é¡ãã¦ãä¸å®æã«Red Hat Developer Hub (以ä¸Developer Hub)é¢é£ã®è¨äºãã¢ãããã¦ãããã¨æãã¾ãã
è¨äºã®å 容ã¯Developer Hubã®å ·ä½çãªè¨å®æ¹æ³ãªã©ã Developer Hubã®ãã¼ã«ã¨ãã¦ã®ä½¿ãæ¹ãæãä¸ãã¦ãããã®ãæ³å®ãã¦ãã¾ãã
以åãRed Hat Developer Hub (Backstage) ã§Golden Pathãä½ãããã¨ããã¿ã¤ãã«ã§Qiitaã«è¨äºãããã¦ãã¾ãããDeveloper Hubã®ãã¼ã¸ã§ã³ãä¸ããããã¤ãå¤æ´ãå¿ è¦ãªç®æãããã®ã§ãæ¹ãã¦ããã§å®è£ æ¹æ³ãç´¹ä»ãã¦ããã¾ãã
第1åã¯Developer Hubã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã§ãã
ï¼æ¬é¡ã®åã«ï¼Developer Hubã¨ã¯ï¼
Developer Hubã¯OSSã§ããBackstageããã¼ã¹ã¨ããéçºè ãã¼ã¿ã«ã§ãã
Backstageãæã¤æ©è½ã«å ãã以ä¸ã®ãããªç¬èªã®æ©è½ã»ãµã¼ãã¹ãæä¾ãã¦ãã¾ãã
- Red Hatãä½æãããµã³ãã«ã®Golden Path Template
- æ§ã ãªãã¼ã«ï¼GitHubãGitLabãArgoCDãªã©ï¼ã¨é£æºããããã®ããªã»ãããã©ã°ã¤ã³
- ãã¼ã¿ã«æ´»ç¨ã®ããã®ä¾¿å©ãªæ©è½ã追å ããç¬èªãã©ã°ã¤ã³
- ç¶ç¶çãªUIæ¹å
- Backstageã®ã³ã¢æ©è½ã¨ãã©ã°ã¤ã³ã«å¯¾ããã¨ã³ã¿ã¼ãã©ã¤ãºã¬ãã«ã®ãµãã¼ã
Developer Hubã¯OpenShiftã ãã§ãªããEKSãAKSä¸ã«ããããã¤ãããã¨ãã§ãã¾ããï¼GKEã¯Dev Previewï¼ 2024å¹´12/23ç¾å¨ã§ã¯ããã¼ã¸ã§ã³1.4ãææ°ã«ãªãã¾ãã
ããããBackstageã£ã¦ãªããªã®ï¼ã¨ããæ¹ã¯ä»¥ä¸ã®ã¹ã©ã¤ããåèã«ãã¦ã¿ã¦ãã ãããBackstageã®åºæ¬çãªã³ã³ã»ãããæ©è½ãç´¹ä»ããã¦ãã¾ãã æè¿Red Hatã«Joinããããªãã(@tanayan299)ãæ¸ãã渾身ã®ã¹ã©ã¤ãã§ãï¼ www.docswell.com
åææ¡ä»¶
- ã¯ã©ã¹ã¿ã¼ç°å¢
- Red Hat OpenShift on AWS(ROSA): 4.16.19
- Cluster API Endpoint: Public
- Cluster API Endpoint: Public
- Red Hat OpenShift on AWS(ROSA): 4.16.19
- GitHub
- github.com ã¢ã«ã¦ã³ã1ã¤
- github.com ã¢ã«ã¦ã³ã1ã¤
- ä½æ¥ç«¯æ«
- Macbook
- oc : 4.16.19
- user-role: cluster-admin
- oc : 4.16.19
- Macbook
Developer Hub ã¤ã³ã¹ãã¼ã«æé
Operatorã®ã¤ã³ã¹ãã¼ã«
ã¾ãã¯Operatorãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ããããã¯å ¨é¨ããã©ã«ãã®ã¾ã¾ã§OKã§ãã
Developer Hubã®ãããã¤
Operatorãã¤ã³ã¹ãã¼ã«ã§ããããã¾ãDeveloper Hubããããã¤ããrhdh
Namespaceãä½æãã¾ãã
oc new-project rhdh
次ã«Developer Hubããããã¤ãã¦ããã¾ããDeveloper Hubã®ãããã¤ã«ã¯ä»¥ä¸ã®yamlãã¡ã¤ã«ã使ãã¾ãã
developer-hub.yaml
apiVersion: rhdh.redhat.com/v1alpha2 kind: Backstage metadata: name: developer-hub namespace: rhdh spec: application: appConfig: configMaps: - name: app-config-rhdh mountPath: /opt/app-root/src extraEnvs: secrets: - name: secrets-rhdh replicas: 1 route: enabled: true dynamicPluginsConfigMapName: dynamic-plugins-rhdh database: enableLocalDb: true
yamlããããã¤ãã¾ãã
oc apply -f developer-hub.yaml
ãã®yamlã§ã¯ãDeveloper Hubã«å¯¾ãã¦ä»¥ä¸ã®3ã¤ã®Configmap/Secretãè¨å®ãã¦ãã¾ãã
app-config-rhdh
: Developer Hub å ã®ãã¾ãã¾ãªè¨å®ã管çããããã® yaml ãã¡ã¤ã«secrets-rhdh
:app-config-rhdh
ãªã©ã§åç §ããç°å¢å¤æ°ããã® Secret ã使ã£ã¦è¨å®ããdynamic-plugins-rhdh
: Dynamic Plugins ã®ã¤ã³ã¹ãã¼ã«è¨å®ç¨ yaml ãã¡ã¤ã«
ãã®ã«ã¹ã¿ã ãªã½ã¼ã¹ã®ä½æã«ãã£ã¦Developer Hubç¨ã®PodãService,Routeãä½æããã¾ãããapp-config-rhdh
/dynamic-plugins-rhdh
ã®Configmapãsecrets-rhdh
ã® SecretããªãããPodãèµ·åãã¾ããããã®ããããã®3ã¤ã®ãªã½ã¼ã¹ããããã¤ãã¦ããã¾ãã
app-config
Configmapã®ãããã¤
ããã§ã¯æä½éã®Configå 容ãè¨è¼ãã¦ãã¾ãã
app-config-rhdh.yaml
kind: ConfigMap apiVersion: v1 metadata: name: app-config-rhdh namesapce: rhdh annotations: rhdh.redhat.com/backstage-name: developer-hub data: app-config-rhdh.yaml: | app: title: Red Hat Developer Hub baseUrl: ${BASE_URL} backend: auth: externalAccess: - type: legacy options: secret: â${BACKEND_SECRET}â subject: legacy-default-config baseUrl: ${BASE_URL} cors: origin: ${BASE_URL}
yamlããããã¤ãã¾ãã
oc apply -f app-config-rhdh.yaml
secrets-rhdh
Secretã®ãããã¤
次ã«å種å¤æ°ã渡ãããã®Secretãä½æãã¾ããããã§ã®å¤æ°ã¯Developer Hubã®Podå ã§ç°å¢å¤æ°ã¨ãã¦è¨å®ãããapp-configãªã©ã«åæ ãããã¨ãã§ãã¾ãã
secrets-rhdh.yaml
apiVersion: v1 kind: Secret metadata: name: secrets-rhdh namespace: rhdh stringData: BASE_URL: "https://backstage-developer-hub-rhdh.apps.<ROSAãã¡ã¤ã³>" BACKEND_SECRET: "<ããã¯ã¨ã³ãèªè¨¼ãã¼>"
BACKEND_SECRET
ã«ã¯base64ã§ã¨ã³ã³ã¼ããããä»»æã®æååã使ç¨ãã¾ããä¾ãã°ä»¥ä¸ã®ã³ãã³ãã®åºåçµæãªã©ã使ãã¾ãããã
node -p 'require("crypto").randomBytes(24).toString("base64")'
yamlããããã¤ãã¾ãã
oc apply -f secrets-rhdh.yaml
dynamic-plugins-rhdh
Configmapã®ãããã¤
æå¾ã«dynamic-pluginã®ã¤ã³ã¹ãã¼ã«è¦å¦ãè¨å®ããConfigmapããããã¤ãã¾ãããã¡ããä¸æ¦ã¯æä½éã®å¤ã®ã¿ãè¨å®ãã¾ãã
kind: ConfigMap apiVersion: v1 metadata: name: dynamic-plugins-rhdh namespace: rhdh annotations: rhdh.redhat.com/backstage-name: developer-hub data: dynamic-plugins.yaml: | includes: - 'dynamic-plugins.default.yaml'
yamlããããã¤ãã¾ãã
oc apply -f dynamic-plugins-rhdh.yaml
è¨å®ã®åæ
ãã¹ã¦ã®Configmapã¨Secretã®ãããã¤ãå®äºããã¨ãPodããããã¤ããã¾ãã
ãã°ããããã¨Podãrunningã«ãªãã®ã§ã以ä¸ã®ã³ãã³ãã§Routeã®URLãåå¾ãããã°ã¤ã³ãã¾ãã
oc get route -n rhdh backstage-developer-hub -o jsonpath={.status.ingress[0].host}
ãã°ã¤ã³ç»é¢ã表示ãããã°ãã²ã¨ã¾ãã¤ã³ã¹ãã¼ã«å®äºã§ãã
ãããã«
ä»åã¯ã²ã¨ã¾ãDeveloper Hubã®ãããã¤ã«ãã©ã¼ã«ã¹ãã¾ããããåãªããã¼ã¿ã«ã®ã¬ã¯ãã§ããã ããªã®ã§ããã®ã¾ã¾ã§ã¯ãã¼ã¿ã«ã¨ãã¦ã®ä¾¡å¤ã¯ã»ã¨ãã©ããã¾ããã
次å以éã®è¨äºã§ã¯ãããã§ã¤ã³ã¹ãã¼ã«ããç°å¢ããã¼ã¹ã«ã©ãã©ãã«ã¹ã¿ãã¤ãºãã¦ããã¾ããä¹ããæå¾ ï¼