Cole Walker bbeef95744 Rework notification messages to remove instance tags
Rework the pull status and subscription notification to remove the top
level instance tags that were returned with the notification. These tags
were originally introduced to identify which PTP instance a given
notification was associated with. Updates to the ORAN standard have
clarified that the instance identification should instead be included in
the Resource Address field.

This commit includes the following changes:
- Update notification format to place instance identifier in Resource
  Address instead of a top level tag (default behaviour)
- Provide a helm override to enable legacy notification format with top
  level instance tags for compatibility. This can be enabled by setting
  the override "notification_format=legacy"
- Ensure GM clockClass is correctly reported for both BC and GM configs
- Changes result in new images for notificationclient-base and
  notificationservice-base-v2
- Pull status notifications are now delivered as a list of dicts when
  there are multiple instances in a request. The "overall sync status"
  message is delivered as a dict because it only ever has a single
  notification
- Push notifications are delivered as individual dicts for each
  notification, this behaviour remains the same

Test plan:
Pass: Verify ptp-notification builds and deploys
Pass: Verify container image builds
Pass: Verify ptp-notification operations (pull status, subscribe, list,
delete)
Pass: Verify standard and legacy format output for each notification
type

Partial-bug: 2089035

Signed-off-by: Cole Walker <cole.walker@windriver.com>
Change-Id: Ied6674a02b41ed31079a291fc9bace74d95d467a
2024-11-20 09:15:35 -05:00

371 lines
13 KiB
YAML

#
# Copyright (c) 2021-2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "notification.fullname" . }}
namespace: {{ .Values.global.namespace }}
labels:
release: {{ .Release.Name }}
app: {{ include "notification.name" . }}
chart: {{ .Chart.Name }}
spec:
selector:
matchLabels:
app: {{ include "notification.name" . }}
release: {{ .Release.Name }}
template:
metadata:
namespace: {{ .Values.global.namespace }}
labels:
app: {{ include "notification.name" . }}
release: {{ .Release.Name }}
app.starlingx.io/component: {{ ternary "application" "platform" .Values.labels.isApplication}}
annotations: {
configchecksum: {{ toYaml .Values.labels | sha256sum | trunc 63 }},
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63}}
}
spec:
imagePullSecrets:
- name: {{ .Values.ptptracking.imagePullSecrets}}
{{ if .Values.ptptracking.device.simulated }}
{{ else }}
{{- if .Values.notification.affinity }}
affinity:
{{ toYaml .Values.notification.affinity | indent 8 }}
{{- end }}
{{ end }}
containers:
- name: {{ .Chart.Name }}-rabbitmq
image: "{{ .Values.notification.image.repository }}:{{ .Values.notification.image.tag }}"
env:
- name: THIS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: THIS_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: THIS_NAMESPACE
value: {{ .Values.global.namespace }}
- name: RABBITMQ_DEFAULT_USER
value: "admin"
- name: RABBITMQ_DEFAULT_PASS
value: "admin"
- name: RABBITMQ_DEFAULT_PORT
value: "5672"
- name: {{ .Chart.Name }}-location
image: "{{ .Values.location.image.repository }}:{{ .Values.location.image.tag }}"
imagePullPolicy: {{ .Values.location.image.pullPolicy }}
tty: true
stdin: true
env:
- name: THIS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: THIS_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: THIS_NAMESPACE
value: {{ .Values.global.namespace }}
- name: REGISTRATION_HOST
value: "{{ .Values.registration.endpoint.host }}"
- name: REGISTRATION_USER
value: "{{ .Values.registration.endpoint.user }}"
- name: REGISTRATION_PASS
value: "{{ .Values.registration.endpoint.pass }}"
- name: REGISTRATION_PORT
value: "{{ .Values.registration.endpoint.port }}"
- name: NOTIFICATIONSERVICE_USER
value: "{{ .Values.notification.endpoint.user }}"
- name: NOTIFICATIONSERVICE_PASS
value: "{{ .Values.notification.endpoint.pass }}"
- name: NOTIFICATIONSERVICE_PORT
value: "{{ .Values.notification.endpoint.port }}"
- name: LOCATION_SERVICE_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: LOCATION_SERVICE_PORT
value: "{{ .Values.location.endpoint.port }}"
- name: LOGGING_LEVEL
value: "{{ .Values.location.log_level }}"
command: ["python3", "/opt/locationservice/locationservice_start.py"]
{{- if .Values.location.endpoint.liveness }}
livenessProbe:
failureThreshold: {{ .Values.location.endpoint.livenessFailureThreshold}}
httpGet:
path: /health
port: {{ .Values.location.endpoint.port }}
scheme: HTTP
initialDelaySeconds: {{ .Values.location.endpoint.livenessDelaySeconds }}
periodSeconds: {{ .Values.location.endpoint.livenessPeriodSeconds }}
successThreshold: 1
timeoutSeconds: {{ .Values.location.endpoint.livenessTimeoutSeconds }}
{{ end }}
volumeMounts:
- name: scripts
mountPath: /mnt
{{- if .Values.ptptrackingv2.enabled }}
- name: {{ .Chart.Name }}-ptptrackingv2
image: "{{ .Values.ptptrackingv2.image.repository }}:{{ .Values.ptptrackingv2.image.tag }}"
imagePullPolicy: {{ .Values.ptptrackingv2.image.pullPolicy }}
tty: true
stdin: true
env:
- name: THIS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: THIS_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: PYTHONPATH
value: /opt/ptptrackingfunction
- name: THIS_NAMESPACE
value: {{ .Values.global.namespace }}
- name: PTP_DEVICE_SIMULATED
value: "{{ .Values.ptptrackingv2.device.simulated }}"
- name: PTP_HOLDOVER_SECONDS
value: "{{ .Values.ptptrackingv2.device.holdover_seconds }}"
- name: OS_CLOCK_HOLDOVER_SECONDS
value: "{{ .Values.ptptrackingv2.osclock.holdover_seconds }}"
- name: OVERALL_HOLDOVER_SECONDS
value: "{{ .Values.ptptrackingv2.overall.holdover_seconds }}"
- name: NOTIFICATIONSERVICE_USER
value: "admin"
- name: NOTIFICATIONSERVICE_PASS
value: "admin"
- name: NOTIFICATIONSERVICE_PORT
value: "5672"
- name: REGISTRATION_USER
value: "admin"
- name: REGISTRATION_PASS
value: "admin"
- name: REGISTRATION_PORT
value: "5672"
- name: REGISTRATION_HOST
value: "registration.{{.Values.global.namespace}}.svc.cluster.local"
- name: HEALTH_API_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: HEALTH_API_PORT
value: "{{ .Values.ptptrackingv2.endpoint.port }}"
- name: PTP4L_SERVICE_NAME
value: "{{ .Values.ptptrackingv2.ptp4lServiceName }}"
- name: PTP4L_CLOCK_CLASS_LOCKED_LIST
value: "{{ .Values.ptptrackingv2.ptp4lClockClassLockedList }}"
- name: PTP4L_UTC_OFFSET
value: "{{ .Values.ptptrackingv2.ptp4lUtcOffset }}"
- name: PHC2SYS_SERVICE_NAME
value: "{{ .Values.ptptrackingv2.phc2sysServiceName }}"
- name: PHC2SYS_TOLERANCE_THRESHOLD
value: "{{ .Values.ptptrackingv2.phc2sysToleranceThreshold }}"
- name: TS2PHC_SERVICE_NAME
value: "{{ .Values.ptptrackingv2.ts2phcServiceName }}"
- name: LOGGING_LEVEL
value: "{{ .Values.ptptrackingv2.log_level }}"
- name: CONTROL_TIMEOUT
value: "{{ .Values.ptptrackingv2.control_timeout }}"
- name: NOTIFICATION_FORMAT
value: "{{ .Values.ptptrackingv2.notification_format }}"
command: ["python3", "/mnt/ptptracking_start_v2.py"]
{{- if .Values.ptptrackingv2.endpoint.liveness }}
livenessProbe:
failureThreshold: {{ .Values.ptptrackingv2.endpoint.livenessFailureThreshold }}
httpGet:
path: /health
port: {{ .Values.ptptrackingv2.endpoint.port }}
scheme: HTTP
initialDelaySeconds: {{ .Values.ptptrackingv2.endpoint.livenessDelaySeconds }}
periodSeconds: {{ .Values.ptptrackingv2.endpoint.livenessPeriodSeconds }}
successThreshold: 1
timeoutSeconds: {{ .Values.ptptrackingv2.endpoint.livenessTimeoutSeconds }}
{{ end }}
securityContext:
privileged: true
capabilities:
add:
- CAP_SYS_ADMIN
volumeMounts:
- name: scripts
mountPath: /mnt
{{ if .Values.ptptrackingv2.device.simulated }}
{{ else }}
- name: ptpdir
mountPath: /var/run/
readOnly: false
- name: pmc
mountPath: /usr/sbin/pmc
readOnly: false
- name: phcctl
mountPath: /usr/sbin/phc_ctl
readOnly: false
{{ end }}
- name: conf
mountPath: /ptp/
readOnly: true
- name: logs
mountPath: /logs/
readOnly: true
- name: ice
mountPath: /ice/
readOnly: true
- name: proc
mountPath: /host/proc/
- name: hostsys
mountPath: /hostsys/
readOnly: true
{{ end }}
{{- if .Values.ptptracking.enabled }}
- name: {{ .Chart.Name }}-ptptracking
image: "{{ .Values.ptptracking.image.repository }}:{{ .Values.ptptracking.image.tag }}"
imagePullPolicy: {{ .Values.ptptracking.image.pullPolicy }}
tty: true
stdin: true
env:
- name: THIS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: THIS_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: THIS_NAMESPACE
value: {{ .Values.global.namespace }}
- name: PTP_DEVICE_SIMULATED
value: "{{ .Values.ptptracking.device.simulated }}"
- name: PTP_HOLDOVER_SECONDS
value: "{{ .Values.ptptracking.device.holdover_seconds }}"
- name: PTP_POLL_FREQ_SECONDS
value: "{{ .Values.ptptracking.device.poll_freq_seconds }}"
- name: NOTIFICATIONSERVICE_USER
value: "admin"
- name: NOTIFICATIONSERVICE_PASS
value: "admin"
- name: NOTIFICATIONSERVICE_PORT
value: "5672"
- name: REGISTRATION_USER
value: "admin"
- name: REGISTRATION_PASS
value: "admin"
- name: REGISTRATION_PORT
value: "5672"
- name: REGISTRATION_HOST
value: "registration.{{.Values.global.namespace}}.svc.cluster.local"
- name: HEALTH_API_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: HEALTH_API_PORT
value: "{{ .Values.ptptracking.endpoint.port }}"
- name: PTP4L_SERVICE_NAME
value: "{{ .Values.ptptracking.ptp4lServiceName }}"
- name: PTP4L_CLOCK_CLASS_LOCKED_LIST
value: "{{ .Values.ptptracking.ptp4lClockClassLockedList }}"
- name: PHC2SYS_SERVICE_NAME
value: "{{ .Values.ptptracking.phc2sysServiceName }}"
- name: PHC2SYS_COM_SOCKET
value: "{{ .Values.ptptracking.phc2sysComSocket }}"
- name: PYTHONPATH
value: "/opt/ptptrackingfunction"
- name: LOGGING_LEVEL
value: "{{ .Values.ptptracking.logging_level }}"
command: ["python3", "/mnt/ptptracking_start.py"]
{{- if .Values.ptptracking.endpoint.liveness }}
livenessProbe:
failureThreshold: {{ .Values.ptptracking.endpoint.livenessFailureThreshold }}
httpGet:
path: /health
port: {{ .Values.ptptracking.endpoint.port }}
scheme: HTTP
initialDelaySeconds: {{ .Values.ptptracking.endpoint.livenessDelaySeconds }}
periodSeconds: {{ .Values.ptptracking.endpoint.livenessPeriodSeconds }}
successThreshold: 1
timeoutSeconds: {{ .Values.ptptracking.endpoint.livenessTimeoutSeconds }}
{{ end }}
securityContext:
privileged: true
capabilities:
add:
- CAP_SYS_ADMIN
volumeMounts:
- name: scripts
mountPath: /mnt
{{ if .Values.ptptracking.device.simulated }}
{{ else }}
- name: ptpdir
mountPath: /var/run/
readOnly: false
- name: varrun
mountPath: {{ .Values.ptptracking.ptp4lSocket }}
readOnly: false
- name: pmc
mountPath: /usr/sbin/pmc
readOnly: false
{{ end }}
- name: conf
mountPath: /ptp/
readOnly: true
{{ end }}
volumes:
- name: scripts
configMap:
name: {{ .Chart.Name }}-scripts-configmap
- name: ptpdir
hostPath:
path: /var/run/
type: Directory
{{ if .Values.ptptracking.device.simulated }}
{{ else }}
- name: varrun
hostPath:
path: {{ .Values.ptptracking.ptp4lSocket }}
type: Socket
{{ end }}
- name: pmc
hostPath:
path: /usr/sbin/pmc
type: File
- name: phcctl
hostPath:
path: /usr/sbin/phc_ctl
type: File
- name: conf
hostPath:
path: /etc/
type: Directory
- name: logs
hostPath:
path: /var/log/
type: Directory
- name: ice
hostPath:
path: /sys/kernel/debug/
type: Directory
- name: proc
hostPath:
path: /proc
type: Directory
- name: hostsys
hostPath:
path: /sys/
type: Directory
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"