-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy OpenWhisk API Gateway #10
Changes from 2 commits
ccdd54f
d57fa3d
d167b17
13d5a4b
0329210
f9aae84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
######################################## | ||
## API Gateway ConfigMap | ||
######################################## | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: apigateway | ||
namespace: openwhisk | ||
data: | ||
api_host: openwhisk-openwhisk.192.168.64.58.nip.io | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bbrowning - actually I thought to deduce that, but don't know how we can do that - if we can do that then I don't need to have those |
||
apigw_url: http://apigateway-openwhisk.192.168.64.58.nip.io | ||
redis_host: "redis.openwhisk.svc.cluster.local" | ||
redis_port: "6379" | ||
######################################## | ||
# START REDIS Deployment | ||
######################################## | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: redis | ||
name: redis | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off here as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
spec: | ||
ports: | ||
- name: redis-6379 | ||
port: 6379 | ||
selector: | ||
app: redis | ||
--- | ||
apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
labels: | ||
app: redis | ||
name: redis | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off. |
||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: redis | ||
name: redis | ||
spec: | ||
containers: | ||
- image: docker.io/redis:3.2 | ||
name: redis | ||
triggers: | ||
- type: ConfigChange | ||
|
||
######################################## | ||
# END REDIS Deployment | ||
######################################## | ||
|
||
######################################## | ||
# START OpenWhisk ApiGateway Deployment | ||
######################################## | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: apigateway | ||
labels: | ||
name: apigateway | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
spec: | ||
selector: | ||
name: apigateway | ||
ports: | ||
- port: 8080 | ||
name: mgmt | ||
- port: 9000 | ||
name: api | ||
--- | ||
apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
name: apigateway | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
labels: | ||
name: apigateway | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
name: apigateway | ||
spec: | ||
restartPolicy: Always | ||
containers: | ||
- name: apigateway | ||
imagePullPolicy: IfNotPresent | ||
image: docker.io/openwhisk/apigateway | ||
ports: | ||
- name: mgmt | ||
containerPort: 8080 | ||
- name: api | ||
containerPort: 9000 | ||
env: | ||
- name: "REDIS_HOST" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: apigateway | ||
key: redis_host | ||
- name: "REDIS_PORT" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: apigateway | ||
key: redis_port | ||
- name: "PUBLIC_GATEWAY_URL" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: apigateway | ||
key: apigw_url | ||
triggers: | ||
- type: ConfigChange | ||
|
||
--- | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
labels: | ||
app: apigateway | ||
name: apigateway | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off. |
||
spec: | ||
port: | ||
targetPort: mgmt | ||
to: | ||
kind: Service | ||
name: apigateway | ||
######################################## | ||
# END OpenWhisk ApiGateway Deployment | ||
######################################## |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: batch/v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo in this filename - should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed. thanks |
||
kind: Job | ||
metadata: | ||
name: install-apimanagement | ||
namespace: openwhisk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leave namespace off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
spec: | ||
activeDeadlineSeconds: 600 | ||
template: | ||
metadata: | ||
name: install-apimanagement | ||
spec: | ||
containers: | ||
- name: apimanagement | ||
image: docker.io/openwhisk/kube-routemgmt | ||
env: | ||
- name: "WHISK_CLI_VERSION" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: whisk.config | ||
key: whisk_cli_version_tag | ||
- name: "WHISK_AUTH" | ||
valueFrom: | ||
secretKeyRef: | ||
name: whisk.auth | ||
key: system | ||
- name: "WHISK_API_HOST_NAME" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: apigateway | ||
key: api_host | ||
- name: "WHISK_NAMESPACE" | ||
valueFrom: | ||
configMapKeyRef: | ||
name: whisk.config | ||
key: whisk_system_namespace | ||
- name: "WHISK_API_GATEWAY_HOST_V2" | ||
value: "http://$(APIGATEWAY_SERVICE_HOST):$(APIGATEWAY_SERVICE_PORT_API)/v2" | ||
|
||
restartPolicy: Never |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Namespace should be left off here like the other OpenShift configs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!