forked from apache/openwhisk-deploy-kube
-
Notifications
You must be signed in to change notification settings - Fork 1
/
invoker.yml
140 lines (128 loc) · 5.36 KB
/
invoker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: invoker
namespace: openwhisk
labels:
name: invoker
spec:
replicas: 1
serviceName: "invoker"
template:
metadata:
labels:
name: invoker
spec:
restartPolicy: Always
volumes:
- name: cgroup
hostPath:
path: "/sys/fs/cgroup"
- name: runc
hostPath:
path: "/run/runc"
- name: dockerrootdir
hostPath:
path: "/var/lib/docker/containers"
- name: dockersock
hostPath:
path: "/var/run/docker.sock"
- name: apparmor
hostPath:
path: "/usr/lib/x86_64-linux-gnu/libapparmor.so.1"
containers:
- name: invoker
imagePullPolicy: Always
# TODO: change this to the public openwhisk image for nuking Consul.
# there is a PR that needs to be merged first.
# https://github.com/apache/incubator-openwhisk/pull/2452
image: danlavine/whisk_invoker
command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /invoker/bin/invoker `hostname | cut -d'-' -f2`" ]
env:
- name: "PORT"
value: "8080"
- name: "SELF_DOCKER_ENDPOINT"
value: "localhost"
- name: "SERVICE_CHECK_HTTP"
value: "/ping"
- name: "SERVICE_CHECK_TIMEOUT"
value: "2s"
- name: "SERVICE_CHECK_INTERVAL"
value: "15s"
- name: "WHISK_API_HOST_NAME"
value: "nginx.openwhisk"
- name: "WHISK_VERSION_BUILDNO"
value: "latest"
- name: "INVOKER_CONTAINER_NETWORK"
value: "bridge"
# Properties for invoker image
- name: "DOCKER_IMAGE_PREFIX"
value: "openwhisk"
- name: "DOCKER_IMAGE_TAG"
value: "latest"
- name: "DOCKER_REGISTRY"
value: ""
# Invoker instance count. Needs to match replica count
- name: "INVOKER_INSTANCES"
value: "1"
# Java options
- name: "JAVA_OPTS"
value: "-Xmx2g"
# Invoker options
- name: "INVOKER_OPTS"
value: ""
# Kafka properties
- name: "KAFKA_HOST"
value: "kafka.openwhisk"
- name: "KAFKA_HOST_PORT"
value: "9092"
# This property can change since it is generated via Ansible GroupVars
- name: "RUNTIMES_MANIFEST"
value: '{ "defaultImagePrefix": "openwhisk", "defaultImageTag": "latest", "runtimes": { "nodejs": [ { "kind": "nodejs", "image": { "name": "nodejsaction" }, "deprecated": true }, { "kind": "nodejs:6", "default": true, "image": { "name": "nodejs6action" }, "deprecated": false } ], "python": [ { "kind": "python", "image": { "name": "python2action" }, "deprecated": false }, { "kind": "python:2", "default": true, "image": { "name": "python2action" }, "deprecated": false }, { "kind": "python:3", "image": { "name": "python3action" }, "deprecated": false } ], "swift": [ { "kind": "swift", "image": { "name": "swiftaction" }, "deprecated": true }, { "kind": "swift:3", "image": { "name": "swift3action" }, "deprecated": false }, { "kind": "swift:3.1.1", "default": true, "image": { "name": "action-swift-v3.1.1" }, "deprecated": false } ], "java": [ { "kind": "java", "default": true, "image": { "name": "java8action" }, "deprecated": false, "attached": { "attachmentName": "jarfile", "attachmentType": "application/java-archive" }, "sentinelledLogs": false, "requireMain": true } ] }, "blackboxes": [ { "name": "dockerskeleton" } ] }'
# Default to empty logs dir. This is because logs should go to stdout
- name: "WHISK_LOGS_DIR"
value: ""
# this version is the day it is deployed,
- name: "WHISK_VERSION_DATE"
value: "2017-01-01T00:00:00Z"
# properties for DB connection
- name: "DB_USERNAME"
value: "couch_user"
- name: "DB_PASSWORD"
value: "couch_password"
- name: "DB_PORT"
value: "5984"
- name: "DB_PROTOCOL"
value: "http"
- name: "DB_HOST"
value: "couchdb.openwhisk"
- name: "DB_PROVIDER"
value: "CouchDB"
- name: "DB_WHISK_ACTIVATIONS"
value: "openwhisk_kube_activations"
- name: "DB_WHISK_ACTIONS"
value: "openwhisk_kube_whisks"
- name: "DB_WHISK_AUTHS"
value: "openwhisk_kube_subjects"
ports:
- name: invoker
containerPort: 8080
volumeMounts:
- name: cgroup
mountPath: "/sys/fs/cgroup"
- name: runc
mountPath: "/run/runc"
- name: dockersock
mountPath: "/var/run/docker.sock"
- name: dockerrootdir
mountPath: "/containers"
- name: apparmor
mountPath: "/usr/lib/x86_64-linux-gnu/libapparmor.so.1"
lifecycle:
postStart:
exec:
command:
- "/bin/bash"
- "-c"
- "docker pull openwhisk/nodejsactionbase && docker pull openwhisk/nodejs6action && docker pull openwhisk/dockerskeleton && docker pull openwhisk/python2action && docker pull openwhisk/python3action && docker pull openwhisk/action-swift-v3.1.1 && docker pull openwhisk/swift3action && docker pull openwhisk/java8action"