Skip to content

maximilianoPizarro/ecommerce-oracle

Repository files navigation

Deploy E-commerce Oracle Helm Charts example on Red Hat OpenShift

Redhat kubernetes Helm shell linkedin Artifact Hub

Installation from OpenShift Dev Spaces

Open in OpenShift Dev Spaces

Open

Run tasks

When your OpenShift Dev Spaces is running, click in Workspace, Select's "Run Tasks" and devfile options with containts Helm charts Web App + Developer Hub and Steps Runnning.

Open OpenShift Console

See the OpenShift Topology.

Access to the Home Page to the Web App.

Get the Web App Route with "oc get route" command from the terminal.

oc get routes ecommerce-oracle
Output
ecommerce-oracle (main) $ oc get routes ecommerce-oracle.
NAME               HOST/PORT                                                                            PATH   SERVICES           PORT   TERMINATION     WILDCARD
ecommerce-oracle   ecommerce-oracle-maximilianopizarro5-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com          ecommerce-oracle   http   edge/Redirect   None

Configure Triggers Web Hook

Access to the WebHook Settings and configure ci-github route.

oc get routes ci-github
Output
ecommerce-oracle (main) $ oc get routes ci-github
NAME        HOST/PORT                                                          PATH   SERVICES       PORT            TERMINATION     WILDCARD
ci-github   ci-github-mpizarro-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com          el-ci-github   http-listener   edge/Redirect   None

Install Developer Hub with Helm Cli (Optional Steps)

See the pipelines.

Review the documentation.

See the App Topology.

See the Web App Logs.

Add OpenShift Helm Charts repo

Open OpenShift Web Terminal and run.

helm repo add openshift-helm-charts https://charts.openshift.io/
Output:
bash-5.1 ~ $ helm repo add openshift-helm-charts https://charts.openshift.io/
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/user/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/user/.kube/config
"openshift-helm-charts" has been added to your repositories

Deploy Developer Hub using Helm Charts Values

Complete Parameters from files.

  1. Update the developer-hub/app-config-rhdh.yaml file.

Token GitHub

https://github.com/settings/tokens/new

-->developer-hub/app-config-rhdh.yaml
    ...
    integrati0ons:
      github:
        - host: github.com
          token: <<TOKEN-GITHUB-REPO>>
    ...

OAuth GitHub Client

https://github.com/settings/developers

-->developer-hub/app-config-rhdh.yaml
        ...
        github:
          development:
            clientId: <<CLIENT-ID>>
            clientSecret: <<CLIENT-SECRET>>
        ...

Base URL

-->developer-hub/app-config-rhdh.yaml
      ...
      baseUrl: <<URL>> https://redhat-developer-hub- <NAMESPACE> .apps.sandbox-m2.ll9k.p1.openshiftapps.com/
      ...
Example:
      ...
      baseUrl: <<URL>> https://redhat-developer-hub-maximilianopizarro5-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com/
      ...

Namespace Role Bindiging

  1. Update the backstage-role-binding-service-account.yaml file.
-->developer-hub/backstage-role-binding-service-account.yaml
       ...
        kind: RoleBinding
        apiVersion: rbac.authorization.k8s.io/v1
        metadata:
          name: 'backstage-read-only'
          namespace: <<NAMESPACE>>
        subjects:
          - kind: User
            apiGroup: rbac.authorization.k8s.io
            name: 'system:serviceaccount: <<NAMESPACE>> :backstage-read-only'
       ...
Example:
       ...
        kind: RoleBinding
        apiVersion: rbac.authorization.k8s.io/v1
        metadata:
          name: 'backstage-read-only'
          namespace: maximilianopizarro5-dev
        subjects:
          - kind: User
            apiGroup: rbac.authorization.k8s.io
            name: 'system:serviceaccount:maximilianopizarro5-dev:backstage-read-only'
       ...

Chart Values

  1. Update the values.yaml file.

Cluster Router Base

-->developer-hub/values.yaml
      ...
        global:
          clusterRouterBase: <<CLUSTER_ROUTER_BASE>>
      ...
Example:
      ...
        global:
          clusterRouterBase: apps.sandbox-m2.ll9k.p1.openshiftapps.com
      ...

K8S_CLUSTER_URL

-->developer-hub/values.yaml
      ...
      - name: K8S_CLUSTER_URL
        value: <<K8S_CLUSTER_URL>>
      ...
Example:
      ...
      - name: K8S_CLUSTER_URL
        value: 'https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443'
      ...

Open OpenShift Web Terminal and run.

helm install redhat-developer-hub openshift-helm-charts/redhat-developer-hub -f developer-hub/values.yaml --version 1.2.2
Output:
bash-5.1 ~ $ helm install redhat-developer-hub openshift-helm-charts/redhat-developer-hub -f developer-hub/values.yaml --version 1.2.2
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/user/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/user/.kube/config
NAME: redhat-developer-hub
LAST DEPLOYED: Thu Aug 22 22:44:39 2024
NAMESPACE: maximilianopizarro5-dev
STATUS: deployed
REVISION: 1
  1. Access to Developer Portal with GitHub Access.

  1. Register Ecommerce Oracle Componet.
https://github.com/maximilianoPizarro/ecommerce-oracle/blob/main/catalog-info.yaml

Install From Helm Charts Command

Charts Values Parameters

Add repository

helm repo add ecommerce-oracle https://maximilianopizarro.github.io/ecommerce-oracle/

Install Chart with parameters

helm install ecommerce-oracle ecommerce-oracle/ecommerce-oracle --version "VERSION" --set route.host=ecommerce-oracle-<NAMESPACE>.apps.sandbox-m2.ll9k.p1.openshiftapps.com
Example:
helm install ecommerce-oracle ecommerce-oracle/ecommerce-oracle --version 0.1.3

Uninstall Chart

helm uninstall ecommerce-oracle

Package Steps Local Build

helm repo add oracle-helm-charts https://maximilianopizarro.github.io/oracle-helm-charts/
helm dependency build
helm package -u . -d charts
helm repo index .

Links