From 2badfec53df34462475da60e6dc4cb56646bea6a Mon Sep 17 00:00:00 2001 From: Tina Kuo Date: Thu, 15 Dec 2022 11:01:04 +0800 Subject: [PATCH] add helm chart for homer heplifyServer-webApp on EKS stack --- .DS_Store | Bin 0 -> 6148 bytes .github/.DS_Store | Bin 0 -> 6148 bytes charts/.DS_Store | Bin 0 -> 6148 bytes .../heplifyServer-webApp-stack-EKS/.DS_Store | Bin 0 -> 6148 bytes .../heplifyServer-webApp-stack-EKS/Chart.yaml | 13 +++ charts/heplifyServer-webApp-stack-EKS/README | 18 ++++ .../templates/heplify-capture-service.yaml | 23 +++++ .../templates/heplify-server-deployment.yaml | 87 ++++++++++++++++++ .../templates/heplify-server-service.yaml | 28 ++++++ .../templates/homer-webapp-deployment.yaml | 43 +++++++++ .../templates/homer-webapp-ingress.yaml | 26 ++++++ .../templates/homer-webapp-service.yaml | 16 ++++ .../values.yaml | 47 ++++++++++ charts/sipcapture/.DS_Store | Bin 0 -> 6148 bytes 14 files changed, 301 insertions(+) create mode 100644 .DS_Store create mode 100644 .github/.DS_Store create mode 100644 charts/.DS_Store create mode 100644 charts/heplifyServer-webApp-stack-EKS/.DS_Store create mode 100644 charts/heplifyServer-webApp-stack-EKS/Chart.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/README create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/heplify-capture-service.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-deployment.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-service.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-deployment.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-ingress.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-service.yaml create mode 100644 charts/heplifyServer-webApp-stack-EKS/values.yaml create mode 100644 charts/sipcapture/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cff4428d956b1ad241adfa693f568c41bce5be5f GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO%b673mzA|7OjGRcnP(>fDt{Y)Wj4G#%yU)b0~$}^o4vCpU0Wq zjkHv+Vr2$qzuo!SWWNo&82}L7akvZ61ONw>u+qTh8zDdGf>f+!1yRr(VR|12O2rG2 zZ1}4T(B9Qx8y+BnYRit_oQBirH(Qg*;a*#IrfoSn-aBZ^qr?5_wBfY2c23UwPw{i2UJdgCKTs{} z7E5@;&fJ2^l~Tf-{Bg4InttQu`q}p6k$>kO{%aZhA`=9mp0C|SQs?vAZ+m= z?30D9P=tOu&M$R12-hID%m6bm&p_1-n{@x5{apXgC-I0GU5WjIneTZ=z~JyQB`HYq2nh78L#w&@^zv4E!nspD&hMW&i*H literal 0 HcmV?d00001 diff --git a/.github/.DS_Store b/.github/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..36b372c72cba58418798b30534145e40b446efdb GIT binary patch literal 6148 zcmeHKJ5EC}5S)b+K{P2TeTCe>ioyxF0D>q@p7bOlMEfevm7_8HDTp3)NfXUV>#^56 zwmik#w*YMOxmyD(086?fzI~XR@4L_Jt|CUH^Nc+PjQGNFcbsMa9dPag86!S$_|1PG z-o|n8ZJ8910#ZN7!Kn+ zdI@6l0I?TNiHy)Jsl=pOwHTIk##`m}!YMK7uxdW6Zno-BENN(xAUn^M3Q+n4QzPpaBFdz{zWMt`My&WY~Ec~Ce+IVMIq=EBSI dQzT_x^Evl>;glG3#)D4O&w%S9lLFUP;0L2O71{s* literal 0 HcmV?d00001 diff --git a/charts/.DS_Store b/charts/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..889103375893d12b1bb1728dd2a61c90e40a001a GIT binary patch literal 6148 zcmeHK%T5A85Uf@XL@yjYnfU<@{=rJ%=%$?7Pl5?!^h&Pm2V%wAGFD~icukp+sx2W-X z|A%~vFy-j|0i76Ne2L3ApGMJXr2~X#5>z8xtTbnrUIaJiIQ-wnPIM$v*+duTV+OpaJ*xX7x|Erocr^l`gX#&8|S>q`%nIH zcpb;#Hi=m(Kn17(6`%rC;Li$J?}e?mfs9mu3Q&P>1?>A!;D$AE3iMA0f{y^e25C2} zeU<nqNaSC)g@=gcxXTWr!QGt6a@C6Jc6{r9J literal 0 HcmV?d00001 diff --git a/charts/heplifyServer-webApp-stack-EKS/Chart.yaml b/charts/heplifyServer-webApp-stack-EKS/Chart.yaml new file mode 100644 index 0000000..f218ba5 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: homer-helm +version: 0.0.1 +kubeVersion: ">= 1.21.0-0" +description: Homer helm chart for heplifyServer-webApp stack on EKS +home: https://sipcapture.org +keywords: + - voip + - monitoring + - pcap + - sip + - rtp +type: application diff --git a/charts/heplifyServer-webApp-stack-EKS/README b/charts/heplifyServer-webApp-stack-EKS/README new file mode 100644 index 0000000..7f3bae3 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/README @@ -0,0 +1,18 @@ +# Homer Helmchart on EKS: heplifyServer-webApp-stack +This Homer helm chart contains two components - [heplifyServer](https://github.com/sipcapture/heplify-server) and [webApp](https://github.com/sipcapture/homer-app). +Please refer to the repositories for more information on setting up. + +# Run the command to check all values in values.yaml are set correctly +``` +helm upgrade --install --dry-run --debug -f values.yaml homer . +``` + +# Run the upgrade (or install) command to install helm chart +``` +helm upgrade --install -f values.yaml homer . +``` + +# Clean up +``` +helm uninstall homer +``` \ No newline at end of file diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/heplify-capture-service.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-capture-service.yaml new file mode 100644 index 0000000..9b28b77 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-capture-service.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + service.beta.kubernetes.io/aws-load-balancer-subnets: {{ toYaml .Values.heplifyServer.annotations.subnets }} + service.beta.kubernetes.io/aws-load-balancer-eip-allocations: {{ toYaml .Values.heplifyServer.annotations.eipAllocations }} + service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing + service.beta.kubernetes.io/aws-load-balancer-type: "external" + service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip" + labels: + service: {{ toYaml .Values.heplifyServer.name }} + name: {{ toYaml .Values.heplifyServer.name }}-capture + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + type: LoadBalancer + ports: + - name: 9060-udp + port: 9060 + protocol: UDP + targetPort: 9060 + selector: + service: {{ toYaml .Values.heplifyServer.name }} diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-deployment.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-deployment.yaml new file mode 100644 index 0000000..8a4a1af --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-deployment.yaml @@ -0,0 +1,87 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + service: {{ toYaml .Values.heplifyServer.name }} + name: {{ toYaml .Values.heplifyServer.name }} + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + replicas: {{ toYaml .Values.replicaCount }} + selector: + matchLabels: + service: {{ toYaml .Values.heplifyServer.name }} + strategy: + type: RollingUpdate + template: + metadata: + labels: + service: {{ toYaml .Values.heplifyServer.name }} + spec: +{{- if .Values.global.tolerations }} + tolerations: +{{ toYaml .Values.global.tolerations | indent 8 }} +{{- end }} +{{- if .Values.global.nodeSelector }} + nodeSelector: +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} + containers: + - args: + - ./heplify-server + env: + - name: HEPLIFYSERVER_ALEGIDS + value: X-CID + - name: HEPLIFYSERVER_DBADDR + value: {{ toYaml .Values.dataBase.dbhost }} + - name: HEPLIFYSERVER_DBBulk + value: "2000" + - name: HEPLIFYSERVER_DBCONFTABLE + value: homer_config + - name: HEPLIFYSERVER_DBDATATABLE + value: homer_data + - name: HEPLIFYSERVER_DBDRIVER + value: {{ toYaml .Values.dataBase.dbDriver }} + - name: HEPLIFYSERVER_DBDROPDAYS + value: "40" + - name: HEPLIFYSERVER_DBDropOnStart + value: "true" + - name: HEPLIFYSERVER_DBPASS + value: {{ toYaml .Values.dataBase.dbPasswd }} + - name: HEPLIFYSERVER_DBROTATE + value: "true" + - name: HEPLIFYSERVER_DBSHEMA + value: homer7 + - name: HEPLIFYSERVER_DBUSER + value: {{ toYaml .Values.dataBase.dbUser }} + - name: HEPLIFYSERVER_DEDUP + value: "false" + - name: HEPLIFYSERVER_FORCEALEGID + value: "true" + - name: HEPLIFYSERVER_HEPADDR + value: 0.0.0.0:9060 + - name: HEPLIFYSERVER_HEPTCPADDR + value: 0.0.0.0:9061 + - name: HEPLIFYSERVER_LOGLVL + value: info + - name: HEPLIFYSERVER_LOGSTD + value: "true" + - name: HEPLIFYSERVER_PROMADDR + value: 0.0.0.0:9096 + - name: HEPLIFYSERVER_PROMTARGETIP + value: {{ toYaml .Values.monitorList.ip }} + - name: HEPLIFYSERVER_PROMTARGETNAME + value: {{ toYaml .Values.monitorList.friendlyName }} + - name: HEPLIFYSERVER_SIPHEADER + value: ruri_user,ruri_domain,from_user,from_domain,from_tag,to_user,to_domain,callid,cseq,method,user_agent + image: {{ toYaml .Values.heplifyServer.spec.image }} + name: {{ toYaml .Values.heplifyServer.name }} + ports: + - containerPort: 9060 + - containerPort: 9060 + protocol: UDP + - containerPort: 9061 + - containerPort: 9096 + - containerPort: 9090 + resources: {} + restartPolicy: Always diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-service.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-service.yaml new file mode 100644 index 0000000..1dd7684 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/heplify-server-service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + service: {{ toYaml .Values.heplifyServer.name }} + name: {{ toYaml .Values.heplifyServer.name }} + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + ports: + - name: "9060" + port: 9060 + targetPort: 9060 + - name: 9060-udp + port: 9060 + protocol: UDP + targetPort: 9060 + - name: "9061" + port: 9061 + targetPort: 9061 + - name: "9096" + port: 9096 + targetPort: 9096 + - name: "9090" + port: 9090 + targetPort: 9090 + type: NodePort + selector: + service: {{ toYaml .Values.heplifyServer.name }} \ No newline at end of file diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-deployment.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-deployment.yaml new file mode 100644 index 0000000..7f2c1c7 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-deployment.yaml @@ -0,0 +1,43 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + service: {{ toYaml .Values.webApp.name }} + name: {{ toYaml .Values.webApp.name }} + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + replicas: {{ toYaml .Values.replicaCount }} + selector: + matchLabels: + service: {{ toYaml .Values.webApp.name }} + strategy: + type: RollingUpdate + template: + metadata: + labels: + app.kubernetes.io/name: {{ toYaml .Values.webApp.name }} + service: {{ toYaml .Values.webApp.name }} + spec: +{{- if .Values.global.tolerations }} + tolerations: +{{ toYaml .Values.global.tolerations | indent 8 }} +{{- end }} +{{- if .Values.global.nodeSelector }} + nodeSelector: +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} + containers: + - env: + - name: DB_HOST + value: {{ toYaml .Values.dataBase.dbhost }} + - name: DB_PASS + value: {{ toYaml .Values.dataBase.dbPasswd }} + - name: DB_USER + value: {{ toYaml .Values.dataBase.dbUser }} + image: {{ toYaml .Values.webApp.spec.image }} + name: {{ toYaml .Values.webApp.name }} + ports: + - containerPort: 80 + resources: {} + restartPolicy: Always diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-ingress.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-ingress.yaml new file mode 100644 index 0000000..dfd644a --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-ingress.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: instance + alb.ingress.kubernetes.io/certificate-arn: {{ toYaml .Values.webApp.annotations.certificateArn }} + labels: + service: {{ toYaml .Values.webApp.name }} + service: {{ toYaml .Values.heplifyServer.name }} + name: {{ toYaml .Values.webApp.name }}-ing + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + rules: + - host: {{ toYaml .Values.webApp.domainName }} + http: + paths: + - backend: + service: + name: {{ toYaml .Values.webApp.name }} + port: + number: 80 + path: "/" + pathType: Prefix \ No newline at end of file diff --git a/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-service.yaml b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-service.yaml new file mode 100644 index 0000000..4b12f1f --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/templates/homer-webapp-service.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + service: {{ toYaml .Values.webApp.name }} + name: {{ toYaml .Values.webApp.name }} + namespace: {{ toYaml .Values.global.nameSpace }} +spec: + ports: + - name: webpage + port: 80 + targetPort: 80 + type: NodePort + selector: + service: {{ toYaml .Values.webApp.name }} \ No newline at end of file diff --git a/charts/heplifyServer-webApp-stack-EKS/values.yaml b/charts/heplifyServer-webApp-stack-EKS/values.yaml new file mode 100644 index 0000000..cfe5455 --- /dev/null +++ b/charts/heplifyServer-webApp-stack-EKS/values.yaml @@ -0,0 +1,47 @@ +replicaCount: 1 +global: + nameSpace: homer-helm + # Set tolerations and nodeselectors if needed + # nodeSelector: + # role: "monitor" + # tolerations: + # - key: "role" + # operator: "Equal" + # value: "monitor" + # effect: "NoSchedule" + +webApp: + domainName: www.example-web.com + name: homer-webapp + annotations: + # Specify the certificate ARN for creating ingress + certificateArn: arn:aws:acm:::certificate/********-****-****-****-************ + spec: + # Build your own image or use the official image sipcapture/webapp + # https://hub.docker.com/r/sipcapture/webapp + image: .dkr.ecr..amazonaws.com//homer-webapp:arm + +heplifyServer: + name: heplify-server + annotations: + # Specify subnetID and EIP ID for creating loadbalancer + # It is important to specify only one subnet and one EIP + # More than one might cause heplify agent failing to send data to heplify server + subnets: subnet-***************** + eipAllocations: eipalloc-***************** + spec: + # Build your own image or use the official image sipcapture/heplify-server + # https://hub.docker.com/r/sipcapture/heplify-server + image: .dkr.ecr..amazonaws.com//homer-heplify-server:arm + +dataBase: + # Host format as domainName:portNumber, ex - www.example.com:1234 + dbhost: www.example-db.com:5432 + dbUser: homerAdmin + dbPasswd: dbPassword + dbDriver: postgres + +monitorList: + # Monitoring target list of ip and friendlyName seperated by comma + ip: 127.0.0.1,192.168.1.1 + friendlyName: localhost,example-servera diff --git a/charts/sipcapture/.DS_Store b/charts/sipcapture/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8d6a5d0cb8fce1fcf8c00953f2add26e1034954e GIT binary patch literal 6148 zcmeHKJ8r`;3?h6Ww+l6f_84h*_zHXoWdYj!B=x8wZc>7q4|BNd=;as-E5`>< bio9ZT?AOFO(CLUf9mt;n(}hL_{#$`7BYqXB literal 0 HcmV?d00001