Browse Source

templates + gitignore

pull/1/head
Nicolas Massé 7 years ago
parent
commit
18c704d631
  1. 1
      .gitignore
  2. 186
      apicast-template.yaml
  3. 61
      pipeline-template.yaml

1
.gitignore

@ -0,0 +1 @@
node_modules

186
apicast-template.yaml

@ -0,0 +1,186 @@
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: apicast
metadata:
annotations:
description: 3scale APIcast for the API Lifecycle Demo
iconClass: icon-load-balancer
tags: api,gateway,3scale
name: api-lifecycle-demo-apicast
objects:
- apiVersion: v1
kind: Secret
metadata:
name: apicast-config
stringData:
password: https://${ACCESS_TOKEN}@${TENANT}-admin.3scale.net/
type: Opaque
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: ${APICAST_NAME}-staging
spec:
replicas: 1
selector:
deploymentconfig: ${APICAST_NAME}-staging
strategy:
type: Rolling
template:
metadata:
labels:
deploymentconfig: ${APICAST_NAME}-staging
spec:
containers:
- env:
- name: THREESCALE_PORTAL_ENDPOINT
valueFrom:
secretKeyRef:
key: password
name: apicast-config
- name: THREESCALE_DEPLOYMENT_ENV
value: staging
- name: APICAST_CONFIGURATION_LOADER
value: lazy
- name: APICAST_LOG_LEVEL
value: info
- name: APICAST_RESPONSE_CODES
value: "true"
- name: APICAST_BACKEND_CACHE_HANDLER
value: resilient
- name: APICAST_CONFIGURATION_CACHE
value: "0"
- name: OPENSSL_VERIFY
value: "false"
image: ${IMAGE_NAME}
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /status/live
port: management
initialDelaySeconds: 10
timeoutSeconds: 1
name: ${APICAST_NAME}
ports:
- containerPort: 8080
name: proxy
protocol: TCP
- containerPort: 8090
name: management
protocol: TCP
readinessProbe:
httpGet:
path: /status/ready
port: management
initialDelaySeconds: 15
timeoutSeconds: 1
triggers:
- type: ConfigChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: ${APICAST_NAME}-production
spec:
replicas: 1
selector:
deploymentconfig: ${APICAST_NAME}-production
strategy:
type: Rolling
template:
metadata:
labels:
deploymentconfig: ${APICAST_NAME}-production
spec:
containers:
- env:
- name: THREESCALE_PORTAL_ENDPOINT
valueFrom:
secretKeyRef:
key: password
name: apicast-config
- name: THREESCALE_DEPLOYMENT_ENV
value: production
- name: APICAST_CONFIGURATION_LOADER
value: boot
- name: APICAST_LOG_LEVEL
value: warn
- name: APICAST_RESPONSE_CODES
value: "true"
- name: APICAST_BACKEND_CACHE_HANDLER
value: resilient
- name: APICAST_CONFIGURATION_CACHE
value: "60"
- name: OPENSSL_VERIFY
value: "false"
image: ${IMAGE_NAME}
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /status/live
port: management
initialDelaySeconds: 10
timeoutSeconds: 1
name: ${APICAST_NAME}
ports:
- containerPort: 8080
name: proxy
protocol: TCP
- containerPort: 8090
name: management
protocol: TCP
readinessProbe:
httpGet:
path: /status/ready
port: management
initialDelaySeconds: 15
timeoutSeconds: 1
triggers:
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
name: ${APICAST_NAME}-staging
spec:
ports:
- name: proxy
port: 8080
protocol: TCP
targetPort: 8080
- name: management
port: 8090
protocol: TCP
targetPort: 8090
selector:
deploymentconfig: ${APICAST_NAME}-staging
- apiVersion: v1
kind: Service
metadata:
name: ${APICAST_NAME}-production
spec:
ports:
- name: proxy
port: 8080
protocol: TCP
targetPort: 8080
- name: management
port: 8090
protocol: TCP
targetPort: 8090
selector:
deploymentconfig: ${APICAST_NAME}-production
parameters:
- description: Docker image to use.
name: IMAGE_NAME
required: true
value: quay.io/3scale/apicast:v3.2.0
- description: Name for the 3scale API Gateway
name: APICAST_NAME
required: true
value: apicast
- description: A 3scale Access Token having read-only access to the Account Management
API
name: ACCESS_TOKEN
required: true
- description: The name of your 3scale tenant
name: TENANT
required: true

61
pipeline-template.yaml

@ -0,0 +1,61 @@
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: rhte-api-pipeline
metadata:
annotations:
description: RHTE Deployment Pipeline
name: rhte-api-pipeline
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
name: rhte-pipeline
name: rhte-pipeline
spec:
output: null
postCommit: null
resources: null
runPolicy: Serial
source:
type: None
source:
git:
uri: ${GIT_REPO}
strategy:
type: JenkinsPipeline
jenkinsPipelineStrategy:
jenkinsfilePath: Jenkinsfile
env:
- name: GIT_BRANCH
value: master
- name: GIT_REPO
value: ${GIT_REPO}
- name: ANSIBLE_TEST_INVENTORY
value: 3scale-test
- name: ANSIBLE_PROD_INVENTORY
value: 3scale-prod
- name: ANSIBLE_JOB_TEMPLATE
value: Deploy an API to 3scale
- name: TOWER_SERVER
value: tower
- name: OPENSHIFT_SERVICE_NAME
value: rhte-api
- name: OPENSHIFT_IMAGE_STREAM
value: rhte-api
- name: OPENSHIFT_BUILD_CONFIG
value: rhte-api
- name: OPENSHIFT_BUILD_PROJECT
value: rhte-build
- name: OPENSHIFT_TEST_ENVIRONMENT
value: rhte-test
- name: OPENSHIFT_PROD_ENVIRONMENT
value: rhte-prod
- name: OPENSHIFT_DEPLOYMENT_CONFIG
value: rhte-api
parameters:
- description: The GIT repository to use.
displayName: GIT Repo URL
name: GIT_REPO
value: https://github.com/nmasse-itix/rhte-api.git
Loading…
Cancel
Save