Browse Source

update the doc to create secure routes by defautl

pull/1/head
Nicolas Massé 7 years ago
parent
commit
948b607869
  1. 14
      README.md
  2. 55
      apicast-routes-template.yaml

14
README.md

@ -71,18 +71,12 @@ oc process -f apicast-template.yaml -p ACCESS_TOKEN=<YOUR_3SCALE_ACCESS_TOKEN> -
### 9/ Create the OpenShift routes for your APIcast gateways
```sh
oc expose svc/apicast-staging --hostname=rhte-api-1-staging.test.app.itix.fr --name rhte-api-1-staging -n rhte-test
oc expose svc/apicast-staging --hostname=rhte-api-2-staging.test.app.itix.fr --name rhte-api-2-staging -n rhte-test
oc expose svc/apicast-production --hostname=rhte-api-1.test.app.itix.fr --name rhte-api-1-production -n rhte-test
oc expose svc/apicast-production --hostname=rhte-api-2.test.app.itix.fr --name rhte-api-2-production -n rhte-test
oc expose svc/apicast-staging --hostname=rhte-api-1-staging.prod.app.itix.fr --name rhte-api-1-staging -n rhte-prod
oc expose svc/apicast-staging --hostname=rhte-api-2-staging.prod.app.itix.fr --name rhte-api-2-staging -n rhte-prod
oc expose svc/apicast-production --hostname=rhte-api-1.prod.app.itix.fr --name rhte-api-1-production -n rhte-prod
oc expose svc/apicast-production --hostname=rhte-api-2.prod.app.itix.fr --name rhte-api-2-production -n rhte-prod
oc process -f apicast-routes-template.yaml -p MAJOR_VERSION=1 -p WILDCARD_DOMAIN=test.app.itix.fr | oc create -f - -n rhte-test
oc process -f apicast-routes-template.yaml -p MAJOR_VERSION=2 -p WILDCARD_DOMAIN=test.app.itix.fr | oc create -f - -n rhte-test
oc process -f apicast-routes-template.yaml -p MAJOR_VERSION=1 -p WILDCARD_DOMAIN=prod.app.itix.fr | oc create -f - -n rhte-prod
oc process -f apicast-routes-template.yaml -p MAJOR_VERSION=2 -p WILDCARD_DOMAIN=prod.app.itix.fr | oc create -f - -n rhte-prod
```
TODO: Patch the routes to enable HTTPS
### 10/ Deploy Ansible Tower
```sh

55
apicast-routes-template.yaml

@ -0,0 +1,55 @@
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: apicast
metadata:
annotations:
description: RHTE APIcast Routes
name: rhte-apicast-routes
objects:
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ${BASE_NAME}-${MAJOR_VERSION}-staging
spec:
host: ${BASE_NAME}-${MAJOR_VERSION}-staging.${WILDCARD_DOMAIN}
port:
targetPort: proxy
tls:
termination: edge
insecureEdgeTerminationPolicy: Allow
to:
kind: Service
name: apicast-staging
weight: 100
wildcardPolicy: None
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ${BASE_NAME}-${MAJOR_VERSION}-production
spec:
host: ${BASE_NAME}-${MAJOR_VERSION}.${WILDCARD_DOMAIN}
port:
targetPort: proxy
tls:
termination: edge
insecureEdgeTerminationPolicy: Allow
to:
kind: Service
name: apicast-production
weight: 100
wildcardPolicy: None
parameters:
- description: The DNS domain under which APIs will be exposed
displayName: 3scale wildcard domain
name: WILDCARD_DOMAIN
required: true
- description: 'The system_name of the API, converted to DNS ("_" -> "-")'
displayName: 3scale API Base Name
name: BASE_NAME
value: rhte-api
required: true
- description: The API major version (1, 2, etc.)
displayName: 3scale API major version
name: MAJOR_VERSION
required: true
Loading…
Cancel
Save