expose kafkaURI; add sdcore-prom-kafka chart
Change-Id: I43a7d9875dc2d9d4739c0abd745a51062940a70b
diff --git a/aether-mock-exporter/Chart.yaml b/aether-mock-exporter/Chart.yaml
index 66d7f9e..a3fd5a3 100644
--- a/aether-mock-exporter/Chart.yaml
+++ b/aether-mock-exporter/Chart.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -7,7 +8,7 @@
description: Aether ROC Mock Exporter
kubeVersion: ">=1.15.0"
type: application
-version: 0.2.0
+version: 0.2.1
appVersion: v0.0.0
keywords:
- aether
diff --git a/aether-mock-exporter/values.yaml b/aether-mock-exporter/values.yaml
index 2f873f8..d0167d2 100644
--- a/aether-mock-exporter/values.yaml
+++ b/aether-mock-exporter/values.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -10,7 +11,7 @@
image:
repository: onosproject/aether-mock-exporter
- tag: v0.4.0
+ tag: v0.4.1
pullPolicy: IfNotPresent
pullSecrets: []
diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml
index 60ddb52..ccfb12e 100644
--- a/aether-roc-umbrella/Chart.yaml
+++ b/aether-roc-umbrella/Chart.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -7,7 +8,7 @@
description: Aether ROC Umbrella chart to deploy all Aether ROC
kubeVersion: ">=1.18.0"
type: application
-version: 2.1.15
+version: 2.1.16
appVersion: v0.0.0
keywords:
- aether
@@ -51,10 +52,15 @@
repository: https://charts.aetherproject.org
version: 2.1.1
alias: sdcore-adapter-v2-0
+ - name: sdcore-prom-kafka
+ condition: import.sdcore-prom-kafka.enabled
+ repository: "file://../sdcore-prom-kafka"
+ version: 1.0.0
+ alias: sdcore-prom-kafka
- name: sdcore-adapter
condition: import.sdcore-adapter.v2-1.enabled
repository: "file://../sdcore-adapter"
- version: 2.1.2
+ version: 2.1.3
alias: sdcore-adapter-v2-1
- name: subscriber-proxy
condition: import.subscriber-proxy.enabled
@@ -97,4 +103,4 @@
- name: aether-mock-exporter
condition: import.aether-mock-exporter.enabled
repository: "file://../aether-mock-exporter"
- version: 0.2.0
+ version: 0.2.1
diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml
index eb19513..b244eac 100644
--- a/aether-roc-umbrella/values.yaml
+++ b/aether-roc-umbrella/values.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -51,6 +52,8 @@
enabled: false
v2-1:
enabled: true
+ sdcore-prom-kafka:
+ enabled: false
subscriber-proxy:
enabled: true
sdcore-test-dummy:
diff --git a/sdcore-adapter/Chart.yaml b/sdcore-adapter/Chart.yaml
index dc20f06..3a0f2b2 100644
--- a/sdcore-adapter/Chart.yaml
+++ b/sdcore-adapter/Chart.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -6,7 +7,7 @@
name: sdcore-adapter
kubeVersion: ">=1.17.0"
type: application
-version: 2.1.2
+version: 2.1.3
appVersion: v2.1.0
description: Aether SD-Core Adapter
keywords:
diff --git a/sdcore-adapter/templates/deployment.yaml b/sdcore-adapter/templates/deployment.yaml
index e85f2e1..132bf65 100644
--- a/sdcore-adapter/templates/deployment.yaml
+++ b/sdcore-adapter/templates/deployment.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -57,6 +58,9 @@
{{ if not .Values.partialUpdateEnabled }}
- "-partial_update_disable"
{{ end }}
+ {{ if .Values.kafkaURI }}
+ - "-kafka_uri={{ .Values.kafkaURI }}"
+ {{ end }}
ports:
{{- range $key, $port := .Values.ports.gnmi }}
- name: gnmi{{ $key }}
diff --git a/sdcore-adapter/values.yaml b/sdcore-adapter/values.yaml
index 1e6eb24..9dca43e 100644
--- a/sdcore-adapter/values.yaml
+++ b/sdcore-adapter/values.yaml
@@ -1,3 +1,4 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
@@ -10,7 +11,7 @@
image:
repository: onosproject/sdcore-adapter
- tag: v0.4.1
+ tag: v0.4.4
pullPolicy: IfNotPresent
pullSecrets: []
@@ -31,6 +32,8 @@
prometheus: 9851
diagApi: 8080
+kafkaURI: ""
+
prometheusEnabled: true
nodeSelector: {}
diff --git a/sdcore-prom-kafka/.helmignore b/sdcore-prom-kafka/.helmignore
new file mode 100644
index 0000000..862263b
--- /dev/null
+++ b/sdcore-prom-kafka/.helmignore
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: 2021 Open Networking Foundation
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/sdcore-prom-kafka/Chart.yaml b/sdcore-prom-kafka/Chart.yaml
new file mode 100644
index 0000000..5580076
--- /dev/null
+++ b/sdcore-prom-kafka/Chart.yaml
@@ -0,0 +1,18 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: v2
+name: sdcore-prom-kafka
+kubeVersion: ">=1.17.0"
+type: application
+version: 1.0.0
+appVersion: v2.1.0
+description: Poll Prometheus for core changes and push to Kafka
+keywords:
+ - aether
+home: https://www.opennetworking.org/aether/
+maintainers:
+ - name: Aether Ops team
+ email: support@opennetworking.org
diff --git a/sdcore-prom-kafka/README.md b/sdcore-prom-kafka/README.md
new file mode 100644
index 0000000..a63e442
--- /dev/null
+++ b/sdcore-prom-kafka/README.md
@@ -0,0 +1,13 @@
+<!--
+SPDX-FileCopyrightText: 2022-present Intel Corporation
+SPDX-FileCopyrightText: 2021 Open Networking Foundation
+
+SPDX-License-Identifier: Apache-2.0
+-->
+
+## SD-Core Prometheus to Kafka
+
+Provides a [Helm] chart for polling from [Prometheus] and pushing to [Kafka].
+
+Note: Be sure to override the values for kafkaURI and prometheusEndpoint if they
+differ for a production deployment.
diff --git a/sdcore-prom-kafka/templates/_helpers.tpl b/sdcore-prom-kafka/templates/_helpers.tpl
new file mode 100644
index 0000000..b913531
--- /dev/null
+++ b/sdcore-prom-kafka/templates/_helpers.tpl
@@ -0,0 +1,57 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+SPDX-FileCopyrightText: 2022-present Intel Corporation
+SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+SPDX-License-Identifier: Apache-2.0
+
+Expand the name of the chart.
+*/}}
+{{- define "sdcore-prom-kafka.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "sdcore-prom-kafka.fullname" -}}
+{{- if .Values.fullnameOverride -}}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "sdcore-prom-kafka.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{/*
+Common labels
+*/}}
+{{- define "sdcore-prom-kafka.labels" -}}
+helm.sh/chart: {{ include "sdcore-prom-kafka.chart" . }}
+{{ include "sdcore-prom-kafka.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "sdcore-prom-kafka.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "sdcore-prom-kafka.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}
diff --git a/sdcore-prom-kafka/templates/configmap.yaml b/sdcore-prom-kafka/templates/configmap.yaml
new file mode 100644
index 0000000..b4de909
--- /dev/null
+++ b/sdcore-prom-kafka/templates/configmap.yaml
@@ -0,0 +1,17 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ template "sdcore-prom-kafka.fullname" . }}-logconfig
+ labels:
+ app: {{ template "sdcore-prom-kafka.fullname" . }}
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ release: "{{ .Release.Name }}"
+ heritage: "{{ .Release.Service }}"
+data:
+ logging.yaml: |-
+{{ toYaml .Values.logging | indent 4 }}
diff --git a/sdcore-prom-kafka/templates/deployment.yaml b/sdcore-prom-kafka/templates/deployment.yaml
new file mode 100644
index 0000000..3604f41
--- /dev/null
+++ b/sdcore-prom-kafka/templates/deployment.yaml
@@ -0,0 +1,63 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "sdcore-prom-kafka.fullname" . }}
+ namespace: {{ .Release.Namespace }}
+ labels:
+ name: {{ template "sdcore-prom-kafka.fullname" . }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ {{- include "sdcore-prom-kafka.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ labels:
+ name: {{ template "sdcore-prom-kafka.fullname" . }}
+ {{- include "sdcore-prom-kafka.selectorLabels" . | nindent 8 }}
+ spec:
+ {{- with .Values.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ securityContext:
+ {{- toYaml .Values.podSecurityContext | nindent 8 }}
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ env:
+ - name: POD_NAMESPACE
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.namespace
+ - name: POD_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.name
+ - name: NODE_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: spec.nodeName
+ args:
+ - "/usr/local/bin/sdcore-kafka"
+ {{ if .Values.kafkaURI }}
+ - "-kafka_uri={{ .Values.kafkaURI }}"
+ {{ end }}
+ {{ if .Values.prometheusEndpoint }}
+ - "-endpoint={{ .Values.prometheusEndpoint }}"
+ {{ end }}
+ volumeMounts:
+ - name: logconfig
+ mountPath: /etc/onos/config
+ readOnly: true
+ volumes:
+ - name: logconfig
+ configMap:
+ name: {{ template "sdcore-prom-kafka.fullname" . }}-logconfig
+
diff --git a/sdcore-prom-kafka/values.yaml b/sdcore-prom-kafka/values.yaml
new file mode 100644
index 0000000..02c72b2
--- /dev/null
+++ b/sdcore-prom-kafka/values.yaml
@@ -0,0 +1,45 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: Apache-2.0
+
+nameOverride: ""
+fullnameOverride: ""
+
+replicaCount: 1
+annotations: {}
+
+image:
+ repository: onosproject/sdcore-adapter
+ tag: v0.4.4
+ pullPolicy: IfNotPresent
+ pullSecrets: []
+
+resources:
+ requests:
+ cpu: 0.5
+ memory: 512Mi
+
+service:
+ type: ClusterIP
+
+kafkaURI: "kafka-0.kafka-headless:9092"
+prometheusEndpoint: "http://aether-roc-umbrella-prometheus-acc-server:80"
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+logging:
+ loggers:
+ root:
+ level: info
+ output:
+ stdout:
+ sink: stdout
+ sinks:
+ stdout:
+ type: stdout
+ stdout: {}