Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update diagram and rename opennms to core #21

Merged
merged 10 commits into from
Jun 27, 2023
24 changes: 24 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Sync README file
on:
push:
branches:
- main
paths:
- 'README.md'
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v2
with:
ref: gh-pages
- run: |
cp -f ${{ runner.temp }}/README.md .
git add README.md
git commit -m "Sync README from main"
git push
Binary file modified diagrams/helm-charts-diagrams.002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/helm-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
hostname: onms-db.shared.svc # Please change it
port: 5432

opennms:
core:
resources:
limits:
cpu: '2'
Expand Down
2 changes: 1 addition & 1 deletion examples/kill-it-with-fire.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
opennms:
core:
terminationGracePeriodSeconds: 5
postConfigJob:
ttlSecondsAfterFinished: 5
2 changes: 1 addition & 1 deletion examples/minimal-resources.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for minimal resource consumption, e.g.: minikube (for testing purposes only)

opennms:
core:
resources: null
configuration:
storage:
Expand Down
10 changes: 5 additions & 5 deletions horizon/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Thank you for installing OpenNMS {{ .Values.opennms.image.tag | default .Values.opennmsVersion }}.
Thank you for installing OpenNMS {{ .Values.core.image.tag | default .Values.opennmsVersion }}.

Your release is named "{{ .Release.Name }}", used for:
- Customer/Deployment identifier.
Expand All @@ -11,10 +11,10 @@ Your release is named "{{ .Release.Name }}", used for:

Resources URLs:

OpenNMS Core: https://onms-core.{{ include "opennms.domain" . }}/opennms/index.jsp
OpenNMS Core: https://onms-core.{{ include "core.domain" . }}/opennms/index.jsp

{{- if gt ((.Values.grafana).replicaCount|int) 0 }}
Grafana: https://grafana.{{ include "opennms.domain" . }}/
Grafana: https://grafana.{{ include "core.domain" . }}/
{{- end }}

To learn more about the release, try:
Expand All @@ -23,14 +23,14 @@ $ helm status {{ .Release.Name }}
$ helm get all {{ .Release.Name }}
$ kubectl get all -n {{ .Release.Name }}

{{- if not .Values.opennms.configuration.alwaysRollDeployment }}
{{- if not .Values.core.configuration.alwaysRollDeployment }}

If OpenNMS needs to be restarted to apply configuration changes, you'll need to restart it, e.g.:

$ kubectl rollout restart -n {{ .Release.Name }} statefulset/onms-core
{{- end }}

{{- if .Values.opennms.inspector.enabled }}
{{- if .Values.core.inspector.enabled }}

The inspector pod is enabled and OpenNMS pod is not running.

Expand Down
30 changes: 15 additions & 15 deletions horizon/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "opennms.name" -}}
{{- define "core.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "opennms.fullname" -}}
{{- define "core.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "opennms.chart" -}}
{{- define "core.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "opennms.labels" -}}
helm.sh/chart: {{ include "opennms.chart" . }}
{{ include "opennms.selectorLabels" . }}
{{- define "core.labels" -}}
helm.sh/chart: {{ include "core.chart" . }}
{{ include "core.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "opennms.selectorLabels" -}}
app.kubernetes.io/name: {{ include "opennms.name" . }}
{{- define "core.selectorLabels" -}}
app.kubernetes.io/name: {{ include "core.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "opennms.serviceAccountName" -}}
{{- define "core.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "opennms.fullname" .) .Values.serviceAccount.name }}
{{- default (include "core.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand All @@ -64,7 +64,7 @@ Create the name of the service account to use
{{/*
Define custom content for JVM_OPTS to conditionally handle Truststores
*/}}
{{- define "opennms.jvmOptions" -}}
{{- define "core.jvmOptions" -}}
{{- $common := "-XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+UseStringDeduplication" }}
{{- if and .Values.dependencies.truststore .Values.dependencies.truststore.content }}
{{- $truststore := "-Djavax.net.ssl.trustStore=/etc/java/jks/truststore.jks" }}
Expand All @@ -81,14 +81,14 @@ Define custom content for JVM_OPTS to conditionally handle Truststores
{{/*
Define whether RRD is enabled
*/}}
{{- define "opennms.enable_tss_rrd" -}}
{{ or (not .Values.opennms.configuration.enable_cortex) .Values.opennms.configuration.enable_tss_dual_write -}}
{{- define "core.enable_tss_rrd" -}}
{{ or (not .Values.core.configuration.enable_cortex) .Values.core.configuration.enable_tss_dual_write -}}
{{- end }}

{{/*
Define common content for Grafana Promtail
*/}}
{{- define "opennms.promtailBaseConfig" -}}
{{- define "core.promtailBaseConfig" -}}
{{- $scheme := "http" -}}
{{- if ((.Values.dependencies).loki).ca_cert -}}
{{- $scheme := "https" -}}
Expand Down Expand Up @@ -124,6 +124,6 @@ scrape_configs:
{{/*
Define Customer/Environment Domain
*/}}
{{- define "opennms.domain" -}}
{{- define "core.domain" -}}
{{- printf "%s.%s" .Release.Name .Values.domain -}}
{{- end }}
12 changes: 6 additions & 6 deletions horizon/templates/app-credentials.secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ metadata:
name: app-credentials
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data:
{{- if ((.Values.dependencies).postgresql).username }}
POSTGRES_USER: {{ .Values.dependencies.postgresql.username | b64enc }}
{{- end }}
{{- if ((.Values.dependencies).postgresql).password }}
POSTGRES_PASSWORD: {{ .Values.dependencies.postgresql.password | b64enc }}
{{- end }}
OPENNMS_DBUSER: {{ .Values.opennms.configuration.database.username | b64enc }}
OPENNMS_DBPASS: {{ .Values.opennms.configuration.database.password | b64enc }}
OPENNMS_HTTP_USER: {{ .Values.opennms.configuration.http.restUsername | b64enc }}
OPENNMS_HTTP_PASS: {{ .Values.opennms.configuration.http.restPassword | b64enc }}
OPENNMS_ADMIN_PASS: {{ required "HTTP admin password (opennms.configuration.http.adminPassword) must be provided" .Values.opennms.configuration.http.adminPassword | b64enc }}
OPENNMS_DBUSER: {{ .Values.core.configuration.database.username | b64enc }}
OPENNMS_DBPASS: {{ .Values.core.configuration.database.password | b64enc }}
OPENNMS_HTTP_USER: {{ .Values.core.configuration.http.restUsername | b64enc }}
OPENNMS_HTTP_PASS: {{ .Values.core.configuration.http.restPassword | b64enc }}
OPENNMS_ADMIN_PASS: {{ required "HTTP admin password (core.configuration.http.adminPassword) must be provided" .Values.core.configuration.http.adminPassword | b64enc }}
{{- if ((.Values.dependencies).kafka).username }}
KAFKA_SASL_USERNAME: {{ .Values.dependencies.kafka.username | b64enc }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion horizon/templates/app-jks.secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: app-jks
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data: # To be mounted at /etc/java/jks
{{- if .Values.dependencies.truststore.content }}
truststore.jks: |
Expand Down
2 changes: 1 addition & 1 deletion horizon/templates/app-scripts.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
name: app-scripts
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data:
{{- (.Files.Glob "scripts/**").AsConfig | nindent 2 }}
22 changes: 11 additions & 11 deletions horizon/templates/app-settings.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ metadata:
name: app-settings
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data:
TZ: {{ .Values.timezone | quote }}
DOMAIN: {{ include "opennms.domain" . | quote }}
DOMAIN: {{ include "core.domain" . | quote }}
POSTGRES_HOST: {{ .Values.dependencies.postgresql.hostname | quote }}
POSTGRES_PORT: {{ .Values.dependencies.postgresql.port | quote }}
POSTGRES_SSL_MODE: {{ .Values.dependencies.postgresql.sslmode | quote }}
POSTGRES_SSL_FACTORY: {{ .Values.dependencies.postgresql.sslfactory | quote }}
ENABLE_ALEC: {{ ((.Values.opennms).configuration).enableAlec | default "false" | quote }}
ENABLE_ACLS: {{ ((.Values.opennms).configuration).enableAcls | default "false" | quote }}
ENABLE_ALEC: {{ ((.Values.core).configuration).enableAlec | default "false" | quote }}
ENABLE_ACLS: {{ ((.Values.core).configuration).enableAcls | default "false" | quote }}
ENABLE_TELEMETRYD: {{ if gt ((.Values.sentinel).replicaCount|int) 0 }}"true"{{ else }}"false"{{ end }}
ENABLE_CORTEX: {{ ((.Values.opennms).configuration).enableCortex | quote }}
ENABLE_TSS_DUAL_WRITE: {{ ((.Values.opennms).configuration).enableTssDualWrite | quote }}
ENABLE_CORTEX: {{ ((.Values.core).configuration).enableCortex | quote }}
ENABLE_TSS_DUAL_WRITE: {{ ((.Values.core).configuration).enableTssDualWrite | quote }}
ENABLE_GRAFANA: {{ if gt ((.Values.grafana).replicaCount|int) 0 }}"true"{{ else }}"false"{{ end }}
OPENNMS_INSTANCE_ID: {{ .Release.Name | quote }}
OPENNMS_SERVER: {{ printf "onms-core.%s.svc" .Release.Name | quote }}
OPENNMS_DBNAME: {{ printf "%s_opennms" .Release.Name | quote }}
{{- if ((.Values.opennms).configuration).rras }}
OPENNMS_RRAS: {{ join ";" .Values.opennms.configuration.rras }}
{{- if ((.Values.core).configuration).rras }}
OPENNMS_RRAS: {{ join ";" .Values.core.configuration.rras }}
{{- end }}
OPENNMS_ETC_UPDATE_POLICY: {{ .Values.opennms.configuration.etcUpdatePolicy }}
{{- if ((.Values.opennms).configuration).enableCortex }}
OPENNMS_ETC_UPDATE_POLICY: {{ .Values.core.configuration.etcUpdatePolicy }}
{{- if ((.Values.core).configuration).enableCortex }}
CORTEX_WRITE_URL: {{ .Values.dependencies.cortex.writeUrl | quote }}
CORTEX_READ_URL: {{ .Values.dependencies.cortex.readUrl | quote }}
CORTEX_MAX_CONCURRENT_HTTP_CONNECTIONS: {{ .Values.dependencies.cortex.maxConcurrentHttpConnections | quote }}
Expand All @@ -48,7 +48,7 @@ data:
KAFKA_SECURITY_PROTOCOL: {{ .Values.dependencies.kafka.configuration.securityProtocol | quote }}
{{- end }}
GRAFANA_SERVER: {{ printf "grafana.%s.svc" .Release.Name | quote }}
GF_SERVER_DOMAIN: {{ printf "grafana.%s" (include "opennms.domain" .) | quote }} # Should match FQDN on the Ingress
GF_SERVER_DOMAIN: {{ printf "grafana.%s" (include "core.domain" .) | quote }} # Should match FQDN on the Ingress
GF_SERVER_ROOT_URL: "/"
GF_DATABASE_TYPE: "postgres"
GF_DATABASE_NAME: {{ printf "%s_grafana" .Release.Name | quote }}
Expand Down
14 changes: 7 additions & 7 deletions horizon/templates/grafana-helm.configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- define "opennms.grafanaDSOptions" -}}
{{- define "core.grafanaDSOptions" -}}
{{- $srv := "onms-core" -}}
editable: true
access: proxy
url: {{ printf "http://%s.%s.svc:8980/opennms" $srv .Release.Name }}
basicAuth: true
basicAuthUser: {{ .Values.opennms.configuration.http.restUsername }}
basicAuthUser: {{ .Values.core.configuration.http.restUsername }}
secureJsonData:
basicAuthPassword: {{ .Values.opennms.configuration.http.restPassword }}
basicAuthPassword: {{ .Values.core.configuration.http.restPassword }}
{{- end }}

{{- if gt ((.Values.grafana).replicaCount|int) 0 }}
Expand All @@ -17,7 +17,7 @@ metadata:
name: helm-config
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data:
plugins.helm.yaml: |
apiVersion: 1
Expand All @@ -30,12 +30,12 @@ data:
- name: OpenNMS-Performance
type: opennms-performance-datasource
isDefault: true
{{- include "opennms.grafanaDSOptions" . | nindent 6 }}
{{- include "core.grafanaDSOptions" . | nindent 6 }}
- name: OpenNMS-Entity
type: opennms-entity-datasource
{{- include "opennms.grafanaDSOptions" . | nindent 6 }}
{{- include "core.grafanaDSOptions" . | nindent 6 }}
- name: OpenNMS-Flow
type: opennms-flow-datasource
{{- include "opennms.grafanaDSOptions" . | nindent 6 }}
{{- include "core.grafanaDSOptions" . | nindent 6 }}

{{- end }}
6 changes: 3 additions & 3 deletions horizon/templates/grafana-helm.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ metadata:
namespace: {{ .Release.Name }}
labels:
app: grafana
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.grafana.replicaCount }}
selector:
matchLabels:
app: grafana
{{- include "opennms.selectorLabels" . | nindent 6 }}
{{- include "core.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: grafana
{{- include "opennms.selectorLabels" . | nindent 8 }}
{{- include "core.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
4 changes: 2 additions & 2 deletions horizon/templates/grafana-helm.service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
namespace: {{ .Release.Name }}
labels:
app: grafana
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
spec:
ports:
- port: 3000
name: http
selector:
app: grafana
{{- include "opennms.selectorLabels" . | nindent 4 }}
{{- include "core.selectorLabels" . | nindent 4 }}
{{- end }}
8 changes: 4 additions & 4 deletions horizon/templates/grafana-promtail.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ metadata:
name: promtail-config
namespace: {{ .Release.Name }}
labels:
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
data:
promtail.onms_core.config.yaml: |
{{- include "opennms.promtailBaseConfig" . | nindent 4 }}
{{- include "core.promtailBaseConfig" . | nindent 4 }}
labels:
job: opennms_core
__path__: /opt/opennms/logs/*.log
promtail.onms_ui.config.yaml: |
{{- include "opennms.promtailBaseConfig" . | nindent 4 }}
{{- include "core.promtailBaseConfig" . | nindent 4 }}
labels:
job: opennms_ui
__path__: /opt/opennms/logs/*.log
promtail.sentinel.config.yaml: |
{{- include "opennms.promtailBaseConfig" . | nindent 4 }}
{{- include "core.promtailBaseConfig" . | nindent 4 }}
labels:
job: opennms_sentinel
__path__: /opt/sentinel/data/log/karaf.log
Expand Down
6 changes: 3 additions & 3 deletions horizon/templates/grafana-renderer.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ metadata:
namespace: {{ .Release.Name }}
labels:
app: grafana-renderer
{{- include "opennms.labels" . | nindent 4 }}
{{- include "core.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.grafana.imageRenderer.replicaCount }}
selector:
matchLabels:
app: grafana-renderer
{{- include "opennms.selectorLabels" . | nindent 6 }}
{{- include "core.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: grafana-renderer
{{- include "opennms.selectorLabels" . | nindent 8 }}
{{- include "core.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
Loading