2023-08-17 20:38:26 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: asterisk
|
|
|
|
annotations:
|
|
|
|
external-dns.alpha.kubernetes.io/hostname: voip.k-space.ee
|
|
|
|
spec:
|
|
|
|
type: LoadBalancer
|
|
|
|
externalTrafficPolicy: Local
|
|
|
|
selector:
|
2023-09-01 10:59:45 +00:00
|
|
|
app: asterisk
|
2023-08-17 20:38:26 +00:00
|
|
|
ports:
|
2023-08-29 06:29:36 +00:00
|
|
|
- name: asterisk
|
2023-08-17 20:38:26 +00:00
|
|
|
protocol: UDP
|
|
|
|
port: 5060
|
2023-09-01 10:59:45 +00:00
|
|
|
- name: sip-data-10000
|
|
|
|
protocol: UDP
|
|
|
|
port: 10000
|
|
|
|
- name: sip-data-10001
|
|
|
|
protocol: UDP
|
|
|
|
port: 10001
|
|
|
|
- name: sip-data-10002
|
|
|
|
protocol: UDP
|
|
|
|
port: 10002
|
|
|
|
- name: sip-data-10003
|
|
|
|
protocol: UDP
|
|
|
|
port: 10003
|
|
|
|
- name: sip-data-10004
|
|
|
|
protocol: UDP
|
|
|
|
port: 10004
|
|
|
|
- name: sip-data-10005
|
|
|
|
protocol: UDP
|
|
|
|
port: 10005
|
|
|
|
- name: sip-data-10006
|
|
|
|
protocol: UDP
|
|
|
|
port: 10006
|
|
|
|
- name: sip-data-10007
|
|
|
|
protocol: UDP
|
|
|
|
port: 10007
|
|
|
|
- name: sip-data-10008
|
|
|
|
protocol: UDP
|
|
|
|
port: 10008
|
|
|
|
- name: sip-data-10009
|
|
|
|
protocol: UDP
|
|
|
|
port: 10009
|
|
|
|
- name: sip-data-10010
|
|
|
|
protocol: UDP
|
|
|
|
port: 10010
|
2023-08-17 20:38:26 +00:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: asterisk
|
|
|
|
labels:
|
|
|
|
app: asterisk
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: asterisk
|
|
|
|
replicas: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: asterisk
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: asterisk
|
|
|
|
image: harbor.k-space.ee/k-space/asterisk
|
2023-08-18 04:42:37 +00:00
|
|
|
command:
|
|
|
|
- /usr/sbin/asterisk
|
|
|
|
args:
|
|
|
|
- -TWBpvvvdddf
|
2023-08-17 20:38:26 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: config
|
|
|
|
mountPath: /etc/asterisk
|
2023-08-18 04:42:37 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 8088
|
|
|
|
name: metrics
|
2023-08-17 20:38:26 +00:00
|
|
|
volumes:
|
|
|
|
- name: config
|
|
|
|
secret:
|
|
|
|
secretName: asterisk-secrets
|
2023-08-18 05:37:58 +00:00
|
|
|
---
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: PodMonitor
|
|
|
|
metadata:
|
|
|
|
name: asterisk
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: asterisk
|
|
|
|
podMetricsEndpoints:
|
|
|
|
- port: metrics
|
|
|
|
---
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: PrometheusRule
|
|
|
|
metadata:
|
|
|
|
name: asterisk
|
|
|
|
spec:
|
|
|
|
groups:
|
|
|
|
- name: asterisk
|
|
|
|
rules:
|
|
|
|
- alert: AsteriskPhoneNotRegistered
|
|
|
|
expr: asterisk_endpoints_state{resource=~"1.*"} < 2
|
|
|
|
for: 5m
|
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
annotations:
|
|
|
|
summary: "{{ $labels.resource }} is not registered."
|
|
|
|
- alert: AsteriskOutboundNumberNotRegistered
|
|
|
|
expr: asterisk_pjsip_outbound_registration_status == 0
|
|
|
|
for: 5m
|
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
annotations:
|
|
|
|
summary: "{{ $labels.username }} is not registered with provider."
|
|
|
|
- alert: AsteriskCallsPerMinuteLimitExceed
|
|
|
|
expr: asterisk_channels_duration_seconds > 10*60
|
|
|
|
for: 20m
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
annotations:
|
|
|
|
summary: "Call at channel {{ $labels.name }} is taking longer than 10m."
|