This is an easy way to deploy a simple 3scale AMP setup using oc cluster up
.
Note: This should only be used for development and testing, do not ever use it in production environments.
You will need:
-
a running instance with 8GB RAM minimum (recommended 16GB) and RHEL
-
<PUBLIC_DNS>
: (e.g.ec2-54-123-456-78.compute-1.amazonaws.com
) -
<PUBLIC_IP>
: (e.g.54.123.456.78
)
(thanks to Toni Syvänen)
- https://github.com/openshift-evangelists/oc-cluster-wrapper
- https://access.redhat.com/downloads/content/290
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
sudo yum install docker docker-registry -y
/etc/sysconfig/docker
:
INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'
sudo systemctl start docker
sudo systemctl status docker
Origin: https://github.com/openshift/origin/releases/latest
or
OCP: https://access.redhat.com/downloads/content/290/
Example:
sudo yum install wget -y
wget https://github.com/openshift/origin/releases/download/v1.4.1/openshift-origin-client-tools-v1.4.1-3f9807a-linux-64bit.tar.gz
tar xzvf openshift-origin-client-tools-v1.4.1-3f9807a-linux-64bit.tar.gz
sudo mv openshift-origin-client-tools-v1.4.1+3f9807a-linux-64bit/oc /usr/bin/
rm -rf openshift-origin-client-tools-v1.4.1*
sudo oc cluster up --public-hostname=<PUBLIC_DNS> --routing-suffix=<PUBLIC_IP>.xip.io
Check out the console:
https://<PUBLIC_DNS>:8443
Since OpenShift v3.6
oc cluster up
creates persistent volumes that can be used by 3scale AMP. If using a previous OpenShift version, or for some other reason the PVs are not there, see the steps to add PVs locally below.
Note: The steps above insall 3scale AMP 2.1. Change the location of the amp.yml
template to deploy a different version.
oc login https://<PUBLIC_DNS>:8443 --insecure-skip-tls-verify
oc new-project 3scale-amp
oc new-app --file https://raw.githubusercontent.com/3scale/3scale-amp-openshift-templates/2.1.0-GA/amp/amp.yml --param WILDCARD_DOMAIN=<PUBLIC_IP>.xip.io
For 2.2
:
oc new-app --file https://raw.githubusercontent.com/3scale/3scale-amp-openshift-templates/2.2.0.GA/amp/amp.yml --param WILDCARD_DOMAIN=<PUBLIC_IP>.xip.io
--> Deploying template "3scale-amp/system" for "amp.yml" to project 3scale-amp
system
---------
Login on https://3scale-admin.<PUBLIC_IP>.xip.io as admin/gu8edykg <===== LOGIN with these credentials
* With parameters:
* AMP_RELEASE=er3
* ADMIN_PASSWORD=gu8edykg # generated
* ADMIN_USERNAME=admin
* APICAST_ACCESS_TOKEN=rthdeuql # generated
* ADMIN_ACCESS_TOKEN=4o2txf0v4e3wgvtw # generated
* WILDCARD_DOMAIN=<PUBLIC_IP>.xip.io
* SUBDOMAIN=3scale
* MySQL User=mysql
* MySQL Password=qfnt75jf # generated
* MySQL Database Name=system
* MySQL Root password.=7dhquse7 # generated
* SYSTEM_BACKEND_USERNAME=3scale_api_user
* SYSTEM_BACKEND_PASSWORD=a3i3n7by # generated
* REDIS_IMAGE=rhscl/redis-32-rhel7:3.2-5.3
* SYSTEM_BACKEND_SHARED_SECRET=s4wpndxj # generated
Log in to the portal using the credentials above, configure the API, deploy APIcast staging adn production.
oc env dc/system-app --overwrite SMTP_ADDRESS=smtp.gmail.com SMTP_USER_NAME=<SMTP_USERNAME> SMTP_PASSWORD=<SMTP_PASSWORD>
oc env dc/system-redis --overwrite SMTP_ADDRESS=smtp.gmail.com SMTP_USER_NAME=<SMTP_USERNAME> SMTP_PASSWORD=<SMTP_PASSWORD>
oc env dc/system-sidekiq --overwrite SMTP_ADDRESS=smtp.gmail.com SMTP_USER_NAME=<SMTP_USERNAME> SMTP_PASSWORD=<SMTP_PASSWORD>
Note: the emails will be sent from the user specified in <SMTP_USERNAME>
This step is only needed when you are using OpenShift cluster deployed with oc cluster up
with version below v3.6
.
sudo su
mkdir -p /var/lib/docker/pv/{01..04}
chmod g+w /var/lib/docker/pv/{01..04}
chcon -Rt svirt_sandbox_file_t /var/lib/docker/pv/
(pv.yml
attached as a separate file)
oc login -u system:admin
oc new-app --param PV=01 -f pv.yml
oc new-app --param PV=02 -f pv.yml
oc new-app --param PV=03 -f pv.yml
oc new-app --param PV=04 -f pv.yml
oc get pv
Create an access token for Account Management API (Read permission is enough) (<ACCESS_TOKEN>
)
oc login https://<PUBLIC_DNS>:8443 --insecure-skip-tls-verify
oc new-project "apicast" --display-name="new-apicast-gateway" --description="3scale apicast gateway"
oc secret new-basicauth apicast-configuration-url-secret --password=https://<ACCESS_TOKEN>@3scale-admin.<PUBLIC_IP>.xip.io
oc new-app --file apicast.yml
oc env dc/apicast --overwrite BACKEND_ENDPOINT_OVERRIDE=https://backend.<PUBLIC_IP>.xip.io
- Create a new Public Base URL in the Integration page
- Add the corresponding route to the
apicast
service