Skip to content

Commit

Permalink
initial support
Browse files Browse the repository at this point in the history
  • Loading branch information
mershad-manesh committed Aug 14, 2023
1 parent 9757979 commit fe22d9f
Show file tree
Hide file tree
Showing 8 changed files with 947 additions and 16 deletions.
9 changes: 7 additions & 2 deletions horizon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: horizon
description: A Helm chart for running OpenNMS Horizon in Kubernetes
home: https://github.com/OpenNMS/helm-charts
icon: https://www.opennms.com/wp-content/uploads/2021/04/OpenNMS_Favicon_36px.png
kubeVersion: ">=1.17.1-0"
annotations:
charts.openshift.io/name: OpenNMS Horizon



# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -17,13 +22,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.0.2-rc1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "32.0.0"
appVersion: "32.0.2"

maintainers:
- name: The OpenNMS Group Inc.
Expand Down
4 changes: 2 additions & 2 deletions horizon/templates/grafana-helm.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ spec:
- name: init # Should run once (regardless of the replicas)
image: {{ printf "%s:%s" (((.Values.grafana.configuration.database).image).repository | default "postgres") (((.Values.grafana.configuration.database).image).tag | default "12") }}
imagePullPolicy: {{ ((.Values.grafana.configuration.database).image).imagePullPolicy | default "IfNotPresent" }}
securityContext:
runAsUser: 999 # postgres user
#securityContext:
# runAsUser: 999 # postgres user
command:
- sh
- /init.sh
Expand Down
34 changes: 34 additions & 0 deletions horizon/templates/opennms-core.route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: {{ include "core.name" . }}
namespace: {{ .Release.Name }}
labels:
app: {{ include "core.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ include "core.name" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
helm.sh/chart: {{ include "core.chart" . }}
spec:
host: {{ printf "onms-core.%s" .Values.domain | quote }}
to:
kind: Service
name: onms-core
weight: 100
port:
targetPort: http
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None
status:
ingress:
- host: {{ printf "onms-core.%s.svc" .Release.Name | quote }}
routerName: default
conditions:
- type: Admitted
status: 'True'
#lastTransitionTime: '2023-08-10T14:16:19Z'
wildcardPolicy: None
routerCanonicalHostname: router-default.apps-crc.testing
21 changes: 20 additions & 1 deletion horizon/templates/opennms-core.statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ spec:
kubectl.kubernetes.io/default-container: "onms"
spec:
securityContext:
fsGroup: 10001
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
# capabilities:
# add:
# - NET_ADMIN
# - NET_RAW
# fsGroup: 10001
terminationGracePeriodSeconds: {{ .Values.core.terminationGracePeriodSeconds | default 120 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -76,6 +83,8 @@ spec:
- secretRef:
name: app-credentials
env:
- name: JAVA_HOME
value: /usr/lib/jvm/java-nocap
- name: OPENNMS_DATABASE_CONNECTION_MAXPOOL
value: {{ .Values.core.configuration.database.poolSize | default "50" | quote }}
volumeMounts:
Expand All @@ -96,6 +105,14 @@ spec:
containers:
- name: onms
image: {{ $image }}
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
# capabilities:
# add:
# - NET_ADMIN
# - NET_RAW
imagePullPolicy: {{ .Values.core.image.pullPolicy }}
args:
- -s
Expand Down Expand Up @@ -141,6 +158,8 @@ spec:
resourceFieldRef:
resource: requests.memory
divisor: 1Mi
- name: JAVA_HOME
value: /usr/lib/jvm/java-nocap
- name: JAVA_OPTS
value: -Xms$(MEM_TOTAL_MB)m -Xmx$(MEM_TOTAL_MB)m {{ $opt }}
{{- end }}
Expand Down
Loading

0 comments on commit fe22d9f

Please sign in to comment.