Skip to content

Commit

Permalink
Merge pull request #131 from chirangaalwis/kubernetes-apim-v2.2.x-is-…
Browse files Browse the repository at this point in the history
…as-km

Adjust Kubernetes resources based on latest Docker image changes - WSO2 APIM v2.2.x
  • Loading branch information
DilanUA authored Sep 17, 2018
2 parents 7ac4042 + 05c6b9a commit 8c651bb
Show file tree
Hide file tree
Showing 32 changed files with 2,905 additions and 132 deletions.
19 changes: 10 additions & 9 deletions pattern-1/apim-analytics/wso2apim-analytics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@ spec:
livenessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 7712
initialDelaySeconds: 250
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 7712
initialDelaySeconds: 250
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 9764
Expand Down Expand Up @@ -114,11 +120,9 @@ spec:
protocol: TCP
volumeMounts:
- name: apim-analytics-conf
mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-analytics-conf-datasources
mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf-datasources
- name: analytics-persistent-disk
mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/conf/analytics
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/datasources
- name: data-persistent-disk
mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/data
serviceAccountName: "wso2svc-account"
Expand All @@ -131,9 +135,6 @@ spec:
- name: apim-analytics-conf-datasources
configMap:
name: apim-analytics-conf-datasources
- name: analytics-persistent-disk
persistentVolumeClaim:
claimName: wso2apim-with-analytics-apim-analytics-volume-claim
- name: data-persistent-disk
persistentVolumeClaim:
claimName: wso2apim-with-analytics-apim-analytics-data-volume-claim
14 changes: 10 additions & 4 deletions pattern-1/apim/wso2apim-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,26 @@ spec:
livenessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 9443
initialDelaySeconds: 150
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 9443
initialDelaySeconds: 150
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 8280
Expand Down Expand Up @@ -81,9 +87,9 @@ spec:
- name: apim-storage-volume
mountPath: /home/wso2carbon/wso2am-2.2.0/repository/deployment/server
- name: apim-conf
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-conf-datasources
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf/datasources
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/datasources
serviceAccountName: "wso2svc-account"
imagePullSecrets:
- name: wso2creds
Expand Down
2 changes: 1 addition & 1 deletion pattern-1/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ echoBold 'Deploying persistent storage resources...'
${KUBECTL} create -f ../volumes/persistent-volumes.yaml

echoBold 'Deploying WSO2 API Manager Analytics...'
${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-volume-claims.yaml
${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-volume-claim.yaml
${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-deployment.yaml
${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-service.yaml
sleep 200s
Expand Down
2 changes: 1 addition & 1 deletion pattern-1/scripts/undeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function echoBold () {
# persistent storage
echoBold 'Deleting persistent volume and volume claim...'
${KUBECTL} delete -f ../apim/wso2apim-volume-claim.yaml
${KUBECTL} delete -f ../apim-analytics/wso2apim-analytics-volume-claims.yaml
${KUBECTL} delete -f ../apim-analytics/wso2apim-analytics-volume-claim.yaml
${KUBECTL} delete -f ../volumes/persistent-volumes.yaml

# WSO2 Identity Server
Expand Down
19 changes: 1 addition & 18 deletions pattern-1/volumes/persistent-volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:
path: "<NFS_LOCATION_PATH>"

---

apiVersion: v1
kind: PersistentVolume
metadata:
Expand All @@ -44,21 +45,3 @@ spec:
nfs:
server: <NFS_SERVER_IP>
path: "<NFS_LOCATION_PATH>"

---

apiVersion: v1
kind: PersistentVolume
metadata:
name: wso2apim-with-analytics-apim-analytics-pv
labels:
purpose: apim-analytics
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
nfs:
server: <NFS_SERVER_IP>
path: "<NFS_LOCATION_PATH>"
19 changes: 10 additions & 9 deletions pattern-2/apim-analytics/wso2apim-analytics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@ spec:
livenessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 7712
initialDelaySeconds: 250
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 7712
initialDelaySeconds: 250
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 9764
Expand Down Expand Up @@ -114,11 +120,9 @@ spec:
protocol: TCP
volumeMounts:
- name: apim-analytics-conf
mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-analytics-conf-datasources
mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf-datasources
- name: analytics-persistent-disk
mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/conf/analytics
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/datasources
- name: data-persistent-disk
mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/data
serviceAccountName: "wso2svc-account"
Expand All @@ -131,9 +135,6 @@ spec:
- name: apim-analytics-conf-datasources
configMap:
name: apim-analytics-conf-datasources
- name: analytics-persistent-disk
persistentVolumeClaim:
claimName: wso2apim-analytics-volume-claim
- name: data-persistent-disk
persistentVolumeClaim:
claimName: wso2apim-analytics-data-volume-claim
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,3 @@ spec:
selector:
matchLabels:
purpose: apim-analytics-data

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wso2apim-analytics-volume-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: ""
selector:
matchLabels:
purpose: apim-analytics
18 changes: 12 additions & 6 deletions pattern-2/apim-gw/wso2apim-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,26 @@ spec:
livenessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 8243
initialDelaySeconds: 300
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/bash
- /bin/sh
- -c
- nc -z localhost 8243
initialDelaySeconds: 300
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 8280
Expand Down Expand Up @@ -81,13 +87,13 @@ spec:
- name: apim-storage-volume
mountPath: /home/wso2carbon/wso2am-2.2.0/repository/deployment/server
- name: apim-gateway-conf
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-gateway-conf-axis2
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf/axis2
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
- name: apim-gateway-conf-datasources
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf/datasources
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/datasources
- name: apim-gateway-conf-identity
mountPath: /home/wso2carbon/kubernetes-volumes/am/conf/identity
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/identity
serviceAccountName: "wso2svc-account"
imagePullSecrets:
- name: wso2creds
Expand Down
90 changes: 90 additions & 0 deletions pattern-2/apim-is-as-km/wso2apim-is-as-km-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

# Copyright (c) 2018, 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: extensions/v1beta1
kind: Deployment
metadata:
name: wso2apim-is-as-km-deployment
spec:
replicas: 1
minReadySeconds: 30
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
deployment: wso2apim-is-as-km
spec:
containers:
- name: wso2apim-is-as-km
image: docker.wso2.com/wso2is-km:5.5.0
livenessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 9443
initialDelaySeconds: 300
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- nc -z localhost 9443
initialDelaySeconds: 300
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ['sh', '-c', '${WSO2_SERVER_HOME}/bin/wso2server.sh stop']
imagePullPolicy: Always
securityContext:
runAsUser: 802
ports:
-
containerPort: 9763
protocol: "TCP"
-
containerPort: 9443
protocol: "TCP"
volumeMounts:
- name: apim-is-as-km-storage-volume
mountPath: /home/wso2carbon/wso2is-km-5.5.0/repository/deployment
- name: apim-is-as-km-conf
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf
- name: apim-is-as-km-conf-axis2
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
- name: apim-is-as-km-conf-datasources
mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/datasources
serviceAccountName: "wso2svc-account"
imagePullSecrets:
- name: wso2creds
volumes:
- name: apim-is-as-km-storage-volume
persistentVolumeClaim:
claimName: wso2apim-is-as-km-shared-server-volume-claim
- name: apim-is-as-km-conf
configMap:
name: apim-is-as-km-conf
- name: apim-is-as-km-conf-axis2
configMap:
name: apim-is-as-km-conf-axis2
- name: apim-is-as-km-conf-datasources
configMap:
name: apim-is-as-km-conf-datasources
33 changes: 33 additions & 0 deletions pattern-2/apim-is-as-km/wso2apim-is-as-km-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2018, 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-km-service
spec:
# label keys and values that must match in order to receive traffic for this service
selector:
deployment: wso2apim-is-as-km
sessionAffinity: ClientIP
ports:
# ports that this service should serve on
-
name: servlet-http
protocol: TCP
port: 9763
-
name: servlet-https
protocol: TCP
port: 9443
Loading

0 comments on commit 8c651bb

Please sign in to comment.