Skip to content

Commit

Permalink
Adding 3scale operator example
Browse files Browse the repository at this point in the history
  • Loading branch information
kevchu3 committed Apr 23, 2020
1 parent 438c1e6 commit 57842c4
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Refer to these instructions to configure additional operators
* [Local storage operator]
* [Prometheus operator with persistent storage]
* [Metering operator]
* [3scale operator]

### 12. Optional: Configure chrony time service

Expand All @@ -143,4 +144,5 @@ Kevin Chung
[Local storage operator]: ./operator/local-storage/
[Prometheus operator with persistent storage]: ./operator/metrics/
[Metering operator]: ./operator/metering/
[3scale operator]: ./operator/3scale/
[Chrony time service]: ./machineconfig/chrony/
13 changes: 13 additions & 0 deletions operator/3scale/3scale-backend-redis.pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: 3scale-backend-redis-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
nfs:
path: /exports/3scale/backend-redis
server: 1.2.3.4
persistentVolumeReclaimPolicy: Retain
13 changes: 13 additions & 0 deletions operator/3scale/3scale-mysql.pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: 3scale-mysql-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
nfs:
path: /exports/3scale/mysql
server: 1.2.3.4
persistentVolumeReclaimPolicy: Retain
13 changes: 13 additions & 0 deletions operator/3scale/3scale-system-redis.pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: 3scale-system-redis-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 5Gi
nfs:
path: /exports/3scale/system-redis
server: 1.2.3.4
persistentVolumeReclaimPolicy: Retain
13 changes: 13 additions & 0 deletions operator/3scale/3scale-system.pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: 3scale-system-volume
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 5Gi
nfs:
path: /exports/3scale/system-redis
server: 1.2.3.4
persistentVolumeReclaimPolicy: Retain
44 changes: 44 additions & 0 deletions operator/3scale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Configure NFS storage for 3scale operator

Refer to the following for additional documentation to [install the 3scale operator].

This section provides steps to configure the 3scale operator to use NFS storage for a lab environment.

### 1. Configure NFS mountpoint

Review the [system requirements] for installing 3scale on OpenShift. You will need the following persistent volumes:
* 3 RWO (ReadWriteOnce) persistent volumes for Redis and MySQL persistence
* 1 RWX (ReadWriteMany) persistent volume for CMS and System-app Assets

```
mkdir -p /exports/3scale/backend-redis
mkdir -p /exports/3scale/mysql
mkdir -p /exports/3scale/system
mkdir -p /exports/3scale/system-redis
chmod -R 777 /exports/3scale/*
chown -R nfsnobody:nfsnobody /exports/3scale/*
echo "/exports/3scale *.yourcluster.domain.com(rw,sync,no_wdelay,root_squash,insecure)" >> /etc/exports
exportfs -rv
```

### 2. Configure NFS storage

From the oc cli, create four persistent volumes of 5Gi each. Use the sample files included and update the reference to the NFS server to your own
```
oc apply -f 3scale-backend-redis.pv.yaml
oc apply -f 3scale-mysql.pv.yaml
oc apply -f 3scale-system.pv.yaml
oc apply -f 3scale-system-redis.pv.yaml
```

### 3. Deploy the APIManager custom resource

Follow the steps from the documentation to [deploy the APIManager custom resource] which utilizes the NFS storage that you previously set up. Use the sample `example.apimanager.yaml` and update the wildcardDomain to your own.
```
oc apply -f example.apimanager.yaml
```

[install the 3scale operator]: https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.8/html-single/installing_3scale/index#installing-threescale-operator-on-openshift
[system requirements]: https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.8/html-single/installing_3scale/index#system-requirements-for-installing-threescale-on-openshift
[deploy the APIManager custom resource]: https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.8/html-single/installing_3scale/index#deploying-apimanager-custom-resource
8 changes: 8 additions & 0 deletions operator/3scale/example.apimanager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps.3scale.net/v1alpha1
kind: APIManager
metadata:
name: example-apimanager
spec:
productVersion: "2.8"
wildcardDomain: <wildcardDomain>
resourceRequirementsEnabled: true

0 comments on commit 57842c4

Please sign in to comment.