Skip to content

Commit

Permalink
Add Kubernetes resources for WSO2 API Manager deployment pattern 3
Browse files Browse the repository at this point in the history
  • Loading branch information
chirangaalwis authored and ctienshi committed Jun 13, 2019
1 parent eaf6f0f commit 68a5885
Show file tree
Hide file tree
Showing 59 changed files with 18,294 additions and 0 deletions.
100 changes: 100 additions & 0 deletions advanced/pattern-3/apim-analytics/wso2apim-analytics-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
name: wso2apim-pattern-3-analytics-worker-deployment
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
deployment: wso2apim-pattern-3-analytics
template:
metadata:
labels:
deployment: wso2apim-pattern-3-analytics
spec:
containers:
- name: wso2apim-analytics-worker
image: wso2/wso2am-analytics-worker:2.6.0
livenessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 9444
initialDelaySeconds: 30
failureThreshold: 3
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 9444
initialDelaySeconds: 30
failureThreshold: 3
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/worker.sh stop']
resources:
requests:
memory: "4Gi"
cpu: "2000m"
limits:
memory: "4Gi"
cpu: "2000m"
securityContext:
runAsUser: 802
ports:
-
containerPort: 7712
protocol: "TCP"
-
containerPort: 7612
protocol: "TCP"
-
containerPort: 9713
protocol: "TCP"
-
containerPort: 9613
protocol: "TCP"
-
containerPort: 9091
protocol: "TCP"
-
containerPort: 9444
protocol: "TCP"
-
containerPort: 7444
protocol: "TCP"
-
containerPort: 7071
protocol: "TCP"
volumeMounts:
- name: apim-analytics-conf-worker
mountPath: /home/wso2carbon/wso2-config-volume/conf/worker
serviceAccountName: "wso2svc-account"
volumes:
- name: apim-analytics-conf-worker
configMap:
name: apim-analytics-conf-worker
47 changes: 47 additions & 0 deletions advanced/pattern-3/apim-analytics/wso2apim-analytics-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: Service
metadata:
name: wso2apim-pattern-3-analytics-service
spec:
# label keys and values that must match in order to receive traffic for this service
selector:
deployment: wso2apim-pattern-3-analytics
ports:
-
name: 'thrift'
port: 7612
protocol: TCP
-
name: 'thrift-ssl'
port: 7712
protocol: TCP
-
name: 'rest-api-port-1'
protocol: TCP
port: 9444
-
name: 'rest-api-port-2'
protocol: TCP
port: 9091
-
name: 'rest-api-port-3'
protocol: TCP
port: 7071
-
name: 'rest-api-port-4'
protocol: TCP
port: 7444
101 changes: 101 additions & 0 deletions advanced/pattern-3/apim-gateway/wso2apim-gateway-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
name: wso2apim-pattern-3-gateway-deployment
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
deployment: wso2apim-pattern-3-gateway
template:
metadata:
labels:
deployment: wso2apim-pattern-3-gateway
spec:
containers:
- name: wso2apim-gateway
image: wso2/wso2am:2.6.0
livenessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 8243
initialDelaySeconds: 240
failureThreshold: 3
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 8243
initialDelaySeconds: 240
failureThreshold: 3
periodSeconds: 10
# command: ["/home/wso2carbon/init.sh"]
# args: ["--optimize", "-Dprofile=gateway-worker"]
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
resources:
requests:
memory: 2Gi
cpu: 2000m
limits:
memory: 3Gi
cpu: 3000m
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 8280
protocol: "TCP"
-
containerPort: 8243
protocol: "TCP"
-
containerPort: 9763
protocol: "TCP"
-
containerPort: 9443
protocol: "TCP"
volumeMounts:
- name: apim-storage-volume
mountPath: /home/wso2carbon/wso2am-2.6.0/repository/deployment/server
- name: apim-gateway-conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-gateway-conf-axis2
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
serviceAccountName: "wso2svc-account"
volumes:
- name: apim-storage-volume
persistentVolumeClaim:
claimName: wso2apim-pattern-3-gateway-shared-server-volume-claim
- name: apim-gateway-conf
configMap:
name: apim-gateway-conf
- name: apim-gateway-conf-axis2
configMap:
name: apim-gateway-conf-axis2
40 changes: 40 additions & 0 deletions advanced/pattern-3/apim-gateway/wso2apim-gateway-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: Service
metadata:
name: wso2apim-pattern-3-gateway-service
spec:
# label keys and values that must match in order to receive traffic for this service
selector:
deployment: wso2apim-pattern-3-gateway
ports:
# ports that this service should serve on
-
name: pass-through-http
protocol: TCP
port: 8280
-
name: pass-through-https
protocol: TCP
port: 8243
-
name: servlet-http
protocol: TCP
port: 9763
-
name: servlet-https
protocol: TCP
port: 9443
28 changes: 28 additions & 0 deletions advanced/pattern-3/apim-gateway/wso2apim-gateway-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wso2apim-pattern-3-gateway-shared-server-volume-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: ""
selector:
matchLabels:
purpose: wso2apim-pattern-3-gateway-shared
Loading

0 comments on commit 68a5885

Please sign in to comment.