Skip to content

Commit 2786921

Browse files
authored
Merge pull request #71 from OpenNMS/issue/#68
Allow user to control services via environment variables
2 parents c61e6af + a5cf29a commit 2786921

File tree

9 files changed

+1518
-1115
lines changed

9 files changed

+1518
-1115
lines changed

.github/workflows/lint-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Lint and Test Charts
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
workflow_dispatch:
46

57
jobs:
68
lint-test:
@@ -48,7 +50,7 @@ jobs:
4850
- name: Setup dependencies
4951
if: steps.list-changed.outputs.changed == 'true'
5052
run: scripts/start-dependencies.sh
51-
53+
5254
- name: Run chart-testing (install)
5355
if: steps.list-changed.outputs.changed == 'true'
5456
run: ct install --chart-dirs . --charts "horizon" --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set createNamespace=false -f examples/minimal-resources.yaml"

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Release Helm Charts
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
push:
5+
branches:
6+
- main
77

88
# Make sure only one copy of this workflow can run at a time.
99
concurrency: ${{ github.workflow }}
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v3
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Configure Git
2121
run: |
2222
git config user.name "$GITHUB_ACTOR"

.github/workflows/readme.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
name: Sync README file
22
on:
3-
push:
4-
branches:
5-
- main
6-
paths:
7-
- 'README.md'
8-
- 'minion/README.md'
9-
- 'horizon/README.md'
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'README.md'
8+
- 'minion/README.md'
9+
- 'horizon/README.md'
1010
jobs:
11-
build:
12-
permissions:
13-
contents: write
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- run: |
18-
cp -f README.md ${{ runner.temp }}/README.md
19-
mkdir ${{ runner.temp }}/minion
20-
cp -f minion/README.md ${{ runner.temp }}/minion/README.md
21-
mkdir ${{ runner.temp }}/horizon
22-
cp -f horizon/README.md ${{ runner.temp }}/horizon/README.md
23-
- uses: actions/checkout@v2
24-
with:
25-
ref: gh-pages
26-
- run: |
27-
cp -f ${{ runner.temp }}/README.md .
28-
cp -f ${{ runner.temp }}/minion/README.md ./minion/README.md
29-
cp -f ${{ runner.temp }}/horizon/README.md ./horizon/README.md
30-
git config user.name "$GITHUB_ACTOR"
31-
git config user.email "[email protected]"
32-
git add -A
33-
git commit -m "Sync README from main"
34-
git push
11+
build:
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- run: |
18+
cp -f README.md ${{ runner.temp }}/README.md
19+
mkdir ${{ runner.temp }}/minion
20+
cp -f minion/README.md ${{ runner.temp }}/minion/README.md
21+
mkdir ${{ runner.temp }}/horizon
22+
cp -f horizon/README.md ${{ runner.temp }}/horizon/README.md
23+
- uses: actions/checkout@v2
24+
with:
25+
ref: gh-pages
26+
- run: |
27+
cp -f ${{ runner.temp }}/README.md .
28+
cp -f ${{ runner.temp }}/minion/README.md ./minion/README.md
29+
cp -f ${{ runner.temp }}/horizon/README.md ./horizon/README.md
30+
git config user.name "$GITHUB_ACTOR"
31+
git config user.email "[email protected]"
32+
git add -A
33+
git commit -m "Sync README from main"
34+
git push

horizon/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ type: application
1717
# This is the chart version. This version number should be incremented each time you make changes
1818
# to the chart and its templates, including the app version.
1919
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20-
version: 1.1.15
20+
version: 1.1.16
2121

2222
# This is the version number of the application being deployed. This version number should be
2323
# incremented each time you make changes to the application. Versions are not expected to
2424
# follow Semantic Versioning. They should reflect the version the application is using.
2525
# It is recommended to use it with quotes.
26-
appVersion: "34.0.1"
26+
appVersion: "34.0.2"
2727

2828
maintainers:
2929
- name: The OpenNMS Group Inc.

horizon/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,40 @@ kubectl create configmap -n $instance $configmap --from-file=lots-of-zeros.zip
124124
| core.configuration.rras[2] | string | `"RRA:AVERAGE:0.5:288:366"` | |
125125
| core.configuration.rras[3] | string | `"RRA:MAX:0.5:288:366"` | |
126126
| core.configuration.rras[4] | string | `"RRA:MIN:0.5:288:366"` | |
127+
| core.configuration.services.ackd.enabled | bool | `true` | |
128+
| core.configuration.services.actiond.enabled | bool | `true` | |
129+
| core.configuration.services.alarmd.enabled | bool | `true` | |
130+
| core.configuration.services.asteriskGateway.enabled | bool | `false` | |
131+
| core.configuration.services.bsmd.enabled | bool | `true` | |
132+
| core.configuration.services.collectd.enabled | bool | `true` | |
133+
| core.configuration.services.correlator.enabled | bool | `false` | |
134+
| core.configuration.services.discovery.enabled | bool | `true` | |
135+
| core.configuration.services.enhancedLinkd.enabled | bool | `true` | |
136+
| core.configuration.services.eventTranslator.enabled | bool | `true` | |
137+
| core.configuration.services.jettyServer.enabled | bool | `true` | |
138+
| core.configuration.services.karafStartupMonitor.enabled | bool | `true` | |
139+
| core.configuration.services.notifd.enabled | bool | `true` | |
140+
| core.configuration.services.passiveStatusd.enabled | bool | `true` | |
141+
| core.configuration.services.perspectivePoller.enabled | bool | `true` | |
142+
| core.configuration.services.pollerd.enabled | bool | `true` | |
143+
| core.configuration.services.provisiond.enabled | bool | `true` | |
144+
| core.configuration.services.queued.enabled | bool | `true` | |
145+
| core.configuration.services.reportd.enabled | bool | `true` | |
146+
| core.configuration.services.rtcd.enabled | bool | `true` | |
147+
| core.configuration.services.scriptd.enabled | bool | `true` | |
148+
| core.configuration.services.snmpPoller.enabled | bool | `false` | |
149+
| core.configuration.services.statsd.enabled | bool | `true` | |
150+
| core.configuration.services.syslogd.enabled | bool | `false` | |
151+
| core.configuration.services.telemetryd.enabled | bool | `true` | |
152+
| core.configuration.services.ticketer.enabled | bool | `true` | |
153+
| core.configuration.services.tl1d.enabled | bool | `false` | |
154+
| core.configuration.services.trapd.enabled | bool | `true` | |
155+
| core.configuration.services.vacuumd.enabled | bool | `true` | |
127156
| core.configuration.storage.etc | string | `"1Gi"` | |
128157
| core.configuration.storage.mibs | string | `nil` | |
129158
| core.configuration.storage.rrd | string | `"1000Gi"` | |
130159
| core.configuration.timeSeriesStrategy | string | `"rrd"` | |
131160
| core.configuration.tolerations | string | `nil` | |
132-
| core.env | object | `{}` | Environment variables to set on the onms container. |
133161
| core.image.pullPolicy | string | `"IfNotPresent"` | |
134162
| core.image.repository | string | `"opennms/horizon"` | |
135163
| core.image.tag | string | `""` | |

horizon/scripts/onms-core-init.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,10 @@ if [[ -v OPENNMS_RRAS ]]; then
594594
done
595595
fi
596596

597-
# Enable Syslogd
598-
echo "Enabling syslogd in ${CONFIG_DIR}/service-configuration.xml"
599-
sed -r -i '/enabled="false"/{$!{N;s/ enabled="false"[>]\n(.*OpenNMS:Name=Syslogd.*)/>\n\1/}}' ${CONFIG_DIR}/service-configuration.xml
600-
601597
# Disable Telemetryd
602598
if [[ ${ENABLE_TELEMETRYD} == "false" ]]; then
603-
echo "Enabling telemetryd in ${CONFIG_DIR}/service-configuration.xml and ${CONFIG_DIR}/org.apache.karaf.features.cfg"
599+
echo "Disable telemetryd in ${CONFIG_DIR}/org.apache.karaf.features.cfg"
604600
sed -i -r '/opennms-flows/d' ${CONFIG_DIR}/org.apache.karaf.features.cfg
605-
sed -i 'N;s/service.*\n\(.*Telemetryd\)/service enabled="false">\n\1/;P;D' ${CONFIG_DIR}/service-configuration.xml
606601
fi
607602

608603
# Cleanup temporary requisition files

horizon/templates/app-settings.configmap.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,35 @@ data:
1919
OPENNMS_DATABASE_CONNECTION_MAXPOOL: {{ .Values.core.configuration.database.maxPool | default "50" | quote }}
2020
ENABLE_ALEC: {{ ((.Values.core).configuration).enableAlec | default "false" | quote }}
2121
ENABLE_ACLS: {{ ((.Values.core).configuration).enableAcls | default "false" | quote }}
22+
CORE_SERVICE_ALARMD_ENABLED: {{ .Values.core.configuration.services.alarmd.enabled | quote }}
23+
CORE_SERVICE_BSMD_ENABLED: {{ .Values.core.configuration.services.bsmd.enabled | quote }}
24+
CORE_SERVICE_TICKETER_ENABLED: {{ .Values.core.configuration.services.ticketer.enabled | quote }}
25+
CORE_SERVICE_CORRELATOR_ENABLED: {{ .Values.core.configuration.services.correlator.enabled | quote }}
26+
CORE_SERVICE_QUEUED_ENABLED: {{ .Values.core.configuration.services.queued.enabled | quote }}
27+
CORE_SERVICE_ACTIOND_ENABLED: {{ .Values.core.configuration.services.actiond.enabled | quote }}
28+
CORE_SERVICE_NOTIFD_ENABLED: {{ .Values.core.configuration.services.notifd.enabled | quote }}
29+
CORE_SERVICE_SCRIPTD_ENABLED: {{ .Values.core.configuration.services.scriptd.enabled | quote }}
30+
CORE_SERVICE_RTCD_ENABLED: {{ .Values.core.configuration.services.rtcd.enabled | quote }}
31+
CORE_SERVICE_POLLERD_ENABLED: {{ .Values.core.configuration.services.pollerd.enabled | quote }}
32+
CORE_SERVICE_SNMPPOLLER_ENABLED: {{ .Values.core.configuration.services.snmpPoller.enabled | quote }}
33+
CORE_SERVICE_ENHANCEDLINKD_ENABLED: {{ .Values.core.configuration.services.enhancedLinkd.enabled | quote }}
34+
CORE_SERVICE_COLLECTD_ENABLED: {{ .Values.core.configuration.services.collectd.enabled | quote }}
35+
CORE_SERVICE_DISCOVERY_ENABLED: {{ .Values.core.configuration.services.discovery.enabled | quote }}
36+
CORE_SERVICE_VACUUMD_ENABLED: {{ .Values.core.configuration.services.vacuumd.enabled | quote }}
37+
CORE_SERVICE_EVENTTRANSLATOR_ENABLED: {{ .Values.core.configuration.services.eventTranslator.enabled | quote }}
38+
CORE_SERVICE_PASSIVESTATUSD_ENABLED: {{ .Values.core.configuration.services.passiveStatusd.enabled | quote }}
39+
CORE_SERVICE_STATSD_ENABLED: {{ .Values.core.configuration.services.statsd.enabled | quote }}
40+
CORE_SERVICE_PROVISIOND_ENABLED: {{ .Values.core.configuration.services.provisiond.enabled | quote }}
41+
CORE_SERVICE_REPORTD_ENABLED: {{ .Values.core.configuration.services.reportd.enabled | quote }}
42+
CORE_SERVICE_ACKD_ENABLED: {{ .Values.core.configuration.services.ackd.enabled | quote }}
43+
CORE_SERVICE_JETTYSERVER_ENABLED: {{ .Values.core.configuration.services.jettyServer.enabled | quote }}
44+
CORE_SERVICE_KARAFSTARTUPMONITOR_ENABLED: {{ .Values.core.configuration.services.karafStartupMonitor.enabled | quote }}
45+
CORE_SERVICE_TL1D_ENABLED: {{ .Values.core.configuration.services.tl1d.enabled | quote }}
46+
CORE_SERVICE_SYSLOGD_ENABLED: {{ .Values.core.configuration.services.syslogd.enabled | quote }}
47+
CORE_SERVICE_ASTERISKGATEWAY_ENABLED: {{ .Values.core.configuration.services.asteriskGateway.enabled | quote }}
48+
CORE_SERVICE_TELEMETRYD_ENABLED: {{ .Values.core.configuration.services.telemetryd.enabled | quote }}
49+
CORE_SERVICE_TRAPD_ENABLED: {{ .Values.core.configuration.services.trapd.enabled | quote }}
50+
CORE_SERVICE_PERSPECTIVEPOLLER_ENABLED: {{ .Values.core.configuration.services.perspectivePoller.enabled | quote }}
2251
ENABLE_TELEMETRYD: {{ if gt ((.Values.sentinel).replicaCount|int) 0 }}"true"{{ else }}"false"{{ end }}
2352
ENABLE_CORTEX: {{ ((.Values.core).configuration).enableCortex | quote }}
2453
ENABLE_TSS_DUAL_WRITE: {{ ((.Values.core).configuration).enableTssDualWrite | quote }}

0 commit comments

Comments
 (0)