Skip to content

Latest commit

 

History

History
165 lines (133 loc) · 7.65 KB

3SCALE_SETUP.md

File metadata and controls

165 lines (133 loc) · 7.65 KB

3Scale Setup

Description

This module will cover how to deploy Red Hat 3Scale 2.9 on Red Hat OpenShift 4.6

Deployment

  • As stated on 3Scale Operator Guide the following requirements must be met:

    3 RWO (ReadWriteOnce) persistent volumes
    1 RWX (ReadWriteMany) persistent volume
    3scale's System component needs a RWX(ReadWriteMany) PersistentVolume for its FileStorage when System's FileStorage is configured to be a PVC (default behavior). System's FileStorage characteristics:
      Contains configuration files read by the System component at run-time
      Stores Static files (HTML, CSS, JS, etc) uploaded to System by its CMS feature, for the purpose of creating a Developer Portal
      System can be scaled horizontally with multiple pods uploading and reading said static files, hence the need for a RWX PersistentVolume when APIManager is configured to use PVC as System's FileStorage
    
    • When using RHPDS you need to deploy an additional Storage Backend (NFS, OCS, etc) or create a PersistentVolumeClaim in order to sucessfully deploy 3Scale.

      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: system-storage
        labels:
          app: 3scale-api-management
          threescale_component: system
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: "100Mi"
        storageClassName: gp2
        volumeMode: Filesystem
      
      oc create -f kubernetes/pvc-storage.yml -n 3scale
      persistentvolumeclaim/system-storage created
      
    • if you want to customize 3Scale Password then create a Kubernetes Secret with the following content:

      apiVersion: v1
      kind: Secret
      metadata:
        name: system-seed
      stringData:
        MASTER_USER: admin
        MASTER_PASSWORD: redhat
        MASTER_ACCESS_TOKEN: redhat
        MASTER_DOMAIN: master
        ADMIN_USER: admin
        ADMIN_PASSWORD: redhat
        ADMIN_ACCESS_TOKEN: redhat
        TENANT_NAME: 3scale
      type: Opaque
      
      oc create -f kubernetes/seed.yml -n 3scale
      secret/system-seed created
      
  • In order to deploy 3scale, navigate to Operators > Installed Operators > Red Hat Integration 3scale -> API Manager > Create APIManager and deploy the API Manager

    • feel free to customize/add the API Manager Name and Labels for your convenience;
    • don´t forget to update the wildcardDomain section with your OpenShift Application domain. Example: apps.openshift.mycompany.com

    API Manager Deploy

    API Manager Deploy

  • If you prefer to use the command line, then create an APIManager Object as follows:

    apiVersion: apps.3scale.net/v1alpha1
    kind: APIManager
    metadata:
     name: instance-3scale
    spec:
     wildcardDomain: $domain
    
    oc create -f kubernetes/api-manager.yml -n 3scale
    
    • when using RHPDS it's recommended to disable Kubernetes Resource Limits and Kubernetes Resource Requests using resourceRequirementsEnabled: false property:

      apiVersion: apps.3scale.net/v1alpha1
      kind: APIManager
      metadata:
       name: instance-3scale
      spec:
       wildcardDomain: $domain
       resourceRequirementsEnabled: false
      
      oc create -f kubernetes/api-manager.yml -n 3scale
      
  • Wait until all pods are successfully started. A similar output is expected:

    oc get pods -n 3scale
    
    NAME                               READY   STATUS      RESTARTS   AGE
    3scale-operator-5f59967f75-vvcdm   1/1     Running     0          80m
    apicast-production-1-29nvc         1/1     Running     0          3m39s
    apicast-production-1-deploy        0/1     Completed   0          4m29s
    apicast-staging-1-deploy           0/1     Completed   0          4m29s
    apicast-staging-1-hjvws            1/1     Running     0          3m39s
    backend-cron-1-deploy              0/1     Completed   0          5m18s
    backend-cron-1-lgbfc               1/1     Running     0          5m15s
    backend-listener-1-deploy          0/1     Completed   0          5m19s
    backend-listener-1-m8r4d           1/1     Running     0          5m15s
    backend-redis-1-5hsh9              1/1     Running     0          5m14s
    backend-redis-1-deploy             0/1     Completed   0          5m17s
    backend-worker-1-deploy            0/1     Completed   0          5m19s
    backend-worker-1-w26rn             1/1     Running     0          5m15s
    system-app-1-deploy                0/1     Completed   0          5m
    system-app-1-hook-post             0/1     Completed   0          71s
    system-app-1-hook-pre              0/1     Completed   0          4m58s
    system-app-1-z5ggv                 3/3     Running     0          2m35s
    system-memcache-1-9lxmj            1/1     Running     0          4m59s
    system-memcache-1-deploy           0/1     Completed   0          5m1s
    system-mysql-1-deploy              0/1     Completed   0          5m16s
    system-mysql-1-j4gzq               1/1     Running     0          5m13s
    system-redis-1-deploy              0/1     Completed   0          5m17s
    system-redis-1-dfmqv               1/1     Running     0          5m14s
    system-sidekiq-1-bvb6k             1/1     Running     0          4m53s
    system-sidekiq-1-deploy            0/1     Completed   0          5m1s
    system-sphinx-1-deploy             0/1     Completed   0          5m
    system-sphinx-1-vzt84              1/1     Running     0          4m58s
    zync-1-7zrx7                       1/1     Running     0          4m44s
    zync-1-deploy                      0/1     Completed   0          4m49s
    zync-database-1-deploy             0/1     Completed   0          4m48s
    zync-database-1-h79m6              1/1     Running     0          4m44s
    zync-que-1-deploy                  0/1     Completed   0          4m49s
    zync-que-1-fklk9                   1/1     Running     2          4m44s
    
    oc get routes -n 3scale | awk '{ print $1, $2 }'
    NAME HOST/PORT
    backend backend-3scale.apps.cluster-620c.620c.example.opentlc.com
    zync-3scale-api-jk8pl api-3scale-apicast-production.apps.cluster-620c.620c.example.opentlc.com
    zync-3scale-api-rgskr api-3scale-apicast-staging.apps.cluster-620c.620c.example.opentlc.com
    zync-3scale-master-wpct6 master.apps.cluster-620c.620c.example.opentlc.com
    zync-3scale-provider-9csj9 3scale-admin.apps.cluster-620c.620c.example.opentlc.com
    zync-3scale-provider-fr9bk 3scale.apps.cluster-620c.620c.example.opentlc.com
    
    oc get routes -n 3scale | grep 3scale-admin | awk '{ print $2 }'
    3scale-admin.apps.cluster-620c.620c.example.opentlc.com
    
  • Try to access 3Scale Admin Portal (e.g https://3scale-admin.apps.cluster-620c.620c.example.opentlc.com/) with the following credentials: admin / redhat

    API Manager Deploy

    API Manager Deploy

  • If something goes wrong please refer to Troubleshooting common 3scale installation issues

References