Skip to content

Commit

Permalink
Support configuration files in ONOS services (#45)
Browse files Browse the repository at this point in the history
* Add support for values-based configuration of services

* Ensure configuration files generated in configmaps are parseable
  • Loading branch information
kuujo authored Mar 18, 2020
1 parent eebe4b4 commit 3cd2920
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 12 deletions.
12 changes: 12 additions & 0 deletions onos-config/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "onos-config.fullname" . }}-config
labels:
app: {{ template "onos-config.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
onos.yaml: |-
{{ toYaml .Values.config | indent 4 }}
14 changes: 10 additions & 4 deletions onos-config/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ spec:
- name: ATOMIX_NAMESPACE
value: {{ .Release.Namespace }}
args:
- "-caPath=/etc/onos-config/certs/tls.cacrt"
- "-keyPath=/etc/onos-config/certs/tls.key"
- "-certPath=/etc/onos-config/certs/tls.crt"
- "-caPath=/etc/onos/certs/tls.cacrt"
- "-keyPath=/etc/onos/certs/tls.key"
- "-certPath=/etc/onos/certs/tls.crt"
{{- range $key, $plugin := .Values.plugins }}
{{- range $j, $v := $plugin.versions }}
- {{ printf "-modelPlugin=/usr/local/lib/shared/%s.so.%s" $key $v }}
Expand Down Expand Up @@ -91,8 +91,11 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/onos/config
readOnly: true
- name: secret
mountPath: /etc/onos-config/certs
mountPath: /etc/onos/certs
readOnly: true
- name: shared-data
mountPath: /usr/local/lib/shared
Expand Down Expand Up @@ -122,6 +125,9 @@ spec:
{{- end }}
# Mount volumes
volumes:
- name: config
configMap:
name: {{ template "onos-config.fullname" . }}-config
- name: secret
secret:
secretName: {{ template "onos-config.fullname" . }}-secret
Expand Down
2 changes: 2 additions & 0 deletions onos-config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ nodeSelector: {}
tolerations: []

affinity: {}

config: {}
12 changes: 12 additions & 0 deletions onos-ric/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "onos-ric.fullname" . }}-config
labels:
app: {{ template "onos-ric.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
onos.yaml: |-
{{ toYaml .Values.config | indent 4 }}
14 changes: 10 additions & 4 deletions onos-ric/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ spec:
- name: ATOMIX_NAMESPACE
value: {{ .Release.Namespace }}
args:
- "-caPath=/etc/onos-ric/certs/tls.cacrt"
- "-keyPath=/etc/onos-ric/certs/tls.key"
- "-certPath=/etc/onos-ric/certs/tls.crt"
- "-caPath=/etc/onos/certs/tls.cacrt"
- "-keyPath=/etc/onos/certs/tls.key"
- "-certPath=/etc/onos/certs/tls.crt"
ports:
- name: grpc
containerPort: 5150
Expand All @@ -76,8 +76,11 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/onos/config
readOnly: true
- name: secret
mountPath: /etc/onos-ric/certs
mountPath: /etc/onos/certs
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand All @@ -89,6 +92,9 @@ spec:
- SYS_PTRACE
{{- end }}
volumes:
- name: config
configMap:
name: {{ template "onos-ric.fullname" . }}-config
- name: secret
secret:
secretName: {{ template "onos-ric.fullname" . }}-secret
Expand Down
2 changes: 2 additions & 0 deletions onos-ric/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ nodeSelector: {}
tolerations: []

affinity: {}

config: {}
12 changes: 12 additions & 0 deletions onos-topo/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "onos-topo.fullname" . }}-config
labels:
app: {{ template "onos-topo.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
onos.yaml: |-
{{ toYaml .Values.config | indent 4 }}
14 changes: 10 additions & 4 deletions onos-topo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ spec:
- name: ATOMIX_NAMESPACE
value: {{ .Release.Namespace }}
args:
- "-caPath=/etc/onos-topo/certs/tls.cacrt"
- "-keyPath=/etc/onos-topo/certs/tls.key"
- "-certPath=/etc/onos-topo/certs/tls.crt"
- "-caPath=/etc/onos/certs/tls.cacrt"
- "-keyPath=/etc/onos/certs/tls.key"
- "-certPath=/etc/onos/certs/tls.crt"
ports:
- name: grpc
containerPort: 5150
Expand All @@ -79,8 +79,11 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/onos/config
readOnly: true
- name: secret
mountPath: /etc/onos-topo/certs
mountPath: /etc/onos/certs
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand All @@ -92,6 +95,9 @@ spec:
- SYS_PTRACE
{{- end }}
volumes:
- name: config
configMap:
name: {{ template "onos-topo.fullname" . }}-config
- name: secret
secret:
secretName: {{ template "onos-topo.fullname" . }}-secret
Expand Down
2 changes: 2 additions & 0 deletions onos-topo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ nodeSelector: {}
tolerations: []

affinity: {}

config: {}

0 comments on commit 3cd2920

Please sign in to comment.