From 2b7acae3e49539d5856dfef073ad2e9ce826582a Mon Sep 17 00:00:00 2001 From: Jordan Halterman Date: Mon, 9 Nov 2020 13:32:17 -0800 Subject: [PATCH] Add onos-e2sub chart --- onos-e2sub/.helmignore | 22 ++++++ onos-e2sub/Chart.yaml | 19 +++++ onos-e2sub/README.md | 4 + onos-e2sub/files/certs/README.md | 20 +++++ onos-e2sub/files/certs/tls.cacrt | 21 +++++ onos-e2sub/files/certs/tls.crt | 21 +++++ onos-e2sub/files/certs/tls.key | 28 +++++++ onos-e2sub/templates/_helpers.tpl | 69 +++++++++++++++++ onos-e2sub/templates/configmap.yaml | 40 ++++++++++ onos-e2sub/templates/database.yaml | 61 +++++++++++++++ onos-e2sub/templates/deployment.yaml | 110 +++++++++++++++++++++++++++ onos-e2sub/templates/secret.yaml | 18 +++++ onos-e2sub/templates/service.yaml | 53 +++++++++++++ onos-e2sub/values.yaml | 82 ++++++++++++++++++++ 14 files changed, 568 insertions(+) create mode 100644 onos-e2sub/.helmignore create mode 100644 onos-e2sub/Chart.yaml create mode 100644 onos-e2sub/README.md create mode 100644 onos-e2sub/files/certs/README.md create mode 100644 onos-e2sub/files/certs/tls.cacrt create mode 100644 onos-e2sub/files/certs/tls.crt create mode 100644 onos-e2sub/files/certs/tls.key create mode 100644 onos-e2sub/templates/_helpers.tpl create mode 100644 onos-e2sub/templates/configmap.yaml create mode 100644 onos-e2sub/templates/database.yaml create mode 100644 onos-e2sub/templates/deployment.yaml create mode 100644 onos-e2sub/templates/secret.yaml create mode 100644 onos-e2sub/templates/service.yaml create mode 100644 onos-e2sub/values.yaml diff --git a/onos-e2sub/.helmignore b/onos-e2sub/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/onos-e2sub/.helmignore @@ -0,0 +1,22 @@ +# 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 +.vscode/ diff --git a/onos-e2sub/Chart.yaml b/onos-e2sub/Chart.yaml new file mode 100644 index 00000000..4ca74037 --- /dev/null +++ b/onos-e2sub/Chart.yaml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v2 +name: onos-e2sub +description: ONOS E2 Subscription Manager +kubeVersion: ">=1.17.0" +type: application +version: 0.0.1 +appVersion: v0.6.0 +keywords: + - onos + - sdn + - ric +home: https://onosproject.org +maintainers: + - name: ONOS Support + email: support@opennetworking.org diff --git a/onos-e2sub/README.md b/onos-e2sub/README.md new file mode 100644 index 00000000..85b3ca78 --- /dev/null +++ b/onos-e2sub/README.md @@ -0,0 +1,4 @@ +## ONOS E2 Subscription Manager + +Provides a [Helm] chart for deploying µONOS E2 Subscription Manager on [Kubernetes]. +See the [documentation](https://docs.onosproject.org/onos-ran/docs/deployment/) for more info. diff --git a/onos-e2sub/files/certs/README.md b/onos-e2sub/files/certs/README.md new file mode 100644 index 00000000..71072739 --- /dev/null +++ b/onos-e2sub/files/certs/README.md @@ -0,0 +1,20 @@ +This folder contains self-signed certificates for use in testing. _DO NOT USE THESE +CERTIFICATES IN PRODUCTION!_ + +The certificates were generated with the +https://github.com/onosproject/simulators/blob/master/pkg/certs/generate_certs.sh +script as +```bash +generate-certs.sh onos-e2t.opennetworking.org +``` + +In this folder they **must** be (re)named +* tls.cacrt +* tls.crt +* tls.key + +Use +```bash +openssl x509 -in deployments/helm/onos-e2t/files/certs/tls.crt -text -noout +``` +to verify the contents (especially the subject). diff --git a/onos-e2sub/files/certs/tls.cacrt b/onos-e2sub/files/certs/tls.cacrt new file mode 100644 index 00000000..d4440bdf --- /dev/null +++ b/onos-e2sub/files/certs/tls.cacrt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MI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0LpllfXtx9N5LanWpB0cu/HN9vAgtp3kRTBZD0M1XI +Ctit8bXV7Mz+1iGqoyUhfCYcCSjuWTgAxzir+hrdn7uO67Hv4ndCoSj4SQaGka3W +eEfVeA== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/onos-e2sub/files/certs/tls.crt b/onos-e2sub/files/certs/tls.crt new file mode 100644 index 00000000..c54a12fe --- /dev/null +++ b/onos-e2sub/files/certs/tls.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDcTCCAlkCFErBGzsXHo1l8bmZRmDkF+h2bsdVMA0GCSqGSIb3DQEBCwUAMHIx +CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJTWVubG9QYXJrMQww +CgYDVQQKDANPTkYxFDASBgNVBAsMC0VuZ2luZWVyaW5nMR4wHAYDVQQDDBVjYS5v +cGVubmV0d29ya2luZy5vcmcwHhcNMjAwOTAxMDYwNTI2WhcNMzAwODMwMDYwNTI2 +WjB4MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFy +azEMMAoGA1UECgwDT05GMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEkMCIGA1UEAwwb +b25vcy1lMnQub3Blbm5ldHdvcmtpbmcub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuNm6b+CvdyNUDUhqU8VNuldAVJtvtXInm7+WCCjpXJtYBw+2 +Amsa1S20Y5h6HnHIxXEsmB8wehQ9jl03CU8Z3YgXI7MJNjFEAHS7AKNfKz7SS92x +oA46wukV3njmN4xk/JZfFrbaUJ4HcE5PVi5dJyyQxg6mPcpdbiYHQ4+uDN4cKU8m +CRWdj4gNUaC+m8+qHqt3V3Vfa8iBMdpskTwT+1jBQcDGt+Ay2iinCAmf5m0pgEka +VghtXIKLUjG/a17FAkgy/sTWJ7J4waD0iRQsEBeQ+4r2MCIttLRk/mTTdBLOkGUi +unzjeh+1EiFslNUwXxu0qfhhJB3KNfwe0bF+LQIDAQABMA0GCSqGSIb3DQEBCwUA +A4IBAQCAron90Id5rzqn73M7FcCN9pFtu1MZ/WYNBxPmrcRc/yZ80PecZoHgTnJh +mBDTLwpoRLPimxTL4OzrnA6Go0kD/CPAThehGb8BBZ+aiSJ17I0/EL1HDmXStgRk +WuqP2DxenckWHaNmPVE0PbB6BCsd5HP0tCC4vGBbGYbJmAhhjzhzEmEypqskt+Np +eFe1DgDyfVrroIHmDLPCEu2ny9Syr/LslDmndGses8/QSVDDyAK/LFFMukCJRWsQ +uIUJM/aDEAqbZUs4bb60hVfcZTU1HVPcp2xuOmVUFKUvHyCpt/n65Y/5XKQYQpTr +1qa1krCQOnuwSstIpqBCnX+TecP7 +-----END CERTIFICATE----- diff --git a/onos-e2sub/files/certs/tls.key b/onos-e2sub/files/certs/tls.key new file mode 100644 index 00000000..ce12d977 --- /dev/null +++ b/onos-e2sub/files/certs/tls.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC42bpv4K93I1QN +SGpTxU26V0BUm2+1ciebv5YIKOlcm1gHD7YCaxrVLbRjmHoeccjFcSyYHzB6FD2O +XTcJTxndiBcjswk2MUQAdLsAo18rPtJL3bGgDjrC6RXeeOY3jGT8ll8WttpQngdw +Tk9WLl0nLJDGDqY9yl1uJgdDj64M3hwpTyYJFZ2PiA1RoL6bz6oeq3dXdV9ryIEx +2myRPBP7WMFBwMa34DLaKKcICZ/mbSmASRpWCG1cgotSMb9rXsUCSDL+xNYnsnjB +oPSJFCwQF5D7ivYwIi20tGT+ZNN0Es6QZSK6fON6H7USIWyU1TBfG7Sp+GEkHco1 +/B7RsX4tAgMBAAECggEBAIvky0HsKx7g77V1vnJTebWyXo8pa2tIT02BusvGGoXp +Ur9VVouR/yaihkhxlsn/ltBGDFe8EvXw530ccpBq+so7OjfcQPZwZmRp8zRSb63M +x15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Mx+8/V4yz6IDKEsAsxK1p7AP6yt6GEWzj8OvrP7cm4Z +NVQirzdY6fbkOULBISdVSWk= +-----END PRIVATE KEY----- diff --git a/onos-e2sub/templates/_helpers.tpl b/onos-e2sub/templates/_helpers.tpl new file mode 100644 index 00000000..fcbf3257 --- /dev/null +++ b/onos-e2sub/templates/_helpers.tpl @@ -0,0 +1,69 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "onos-e2sub.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 "onos-e2sub.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 "onos-e2sub.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "onos-e2sub.labels" -}} +helm.sh/chart: {{ include "onos-e2sub.chart" . }} +{{ include "onos-e2sub.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "onos-e2sub.selectorLabels" -}} +app.kubernetes.io/name: {{ include "onos-e2sub.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +onos-e2sub image name +*/}} +{{- define "onos-e2sub.imagename" -}} +{{- if .Values.global.image.registry -}} +{{- printf "%s/" .Values.global.image.registry -}} +{{- else if .Values.image.registry -}} +{{- printf "%s/" .Values.image.registry -}} +{{- end -}} +{{- printf "%s:" .Values.image.repository -}} +{{- if .Values.global.image.tag -}} +{{- .Values.global.image.tag -}} +{{- else -}} +{{- .Values.image.tag -}} +{{- end -}} +{{- end -}} diff --git a/onos-e2sub/templates/configmap.yaml b/onos-e2sub/templates/configmap.yaml new file mode 100644 index 00000000..6e11c538 --- /dev/null +++ b/onos-e2sub/templates/configmap.yaml @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "onos-e2sub.fullname" . }}-config + labels: + app: {{ template "onos-e2sub.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + onos.yaml: |- + atomix: + {{- if .Values.global.storage.controller }} + controller: {{ .Values.global.storage.controller }} + {{- else }} + controller: {{ .Values.storage.controller }} + {{- end }} + namespace: {{ .Release.Namespace }} + scope: {{ template "onos-e2sub.fullname" . }} + {{- if .Values.storage.consensus.enabled }} + databases: + {{- if .Values.storage.consensus.name }} + config: {{ .Values.storage.consensus.name }} + {{- else }} + config: {{ template "onos-e2sub.fullname" . }}-consensus-db + {{- end }} + {{- else if .Values.global.storage.consensus.enabled }} + databases: + {{- if .Values.global.storage.consensus.name }} + config: {{ .Values.global.storage.consensus.name }} + {{- else }} + config: {{ template "global.fullname" . }}-consensus-db + {{- end }} + {{- end }} + logging.yaml: |- + {{ toYaml .Values.logging | indent 4 }} diff --git a/onos-e2sub/templates/database.yaml b/onos-e2sub/templates/database.yaml new file mode 100644 index 00000000..ccfe7ccc --- /dev/null +++ b/onos-e2sub/templates/database.yaml @@ -0,0 +1,61 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +{{- if .Values.storage.consensus.enabled }} +{{- $name := ternary .Values.storage.consensus.name (printf "%s-consensus-db" (include "onos-e2sub.fullname" .)) (not (eq .Values.storage.consensus.name "")) }} +apiVersion: cloud.atomix.io/v1beta3 +kind: Database +metadata: + name: {{ $name }} + namespace: {{ .Release.Namespace }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + partitions: {{ .Values.storage.consensus.partitions }} + storageClass: + group: storage.cloud.atomix.io + version: v1beta1 + {{- if eq .Values.storage.consensus.type "raft" }} + kind: RaftStorageClass + {{- else if eq .Values.storage.consensus.type "cache" }} + kind: CacheStorageClass + {{- else }} + {{ fail ( printf "%s is not a valid storage type" .Values.storage.consensus.type ) }} + {{- end }} + name: {{ $name }} +--- +{{- if eq .Values.storage.consensus.type "raft" }} +apiVersion: storage.cloud.atomix.io/v1beta1 +kind: RaftStorageClass +metadata: + name: {{ $name }} + namespace: {{ .Release.Namespace }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + image: {{ default "atomix/raft-storage-node:v0.4.0" .Values.storage.consensus.image }} + imagePullPolicy: {{ .Values.storage.consensus.imagePullPolicy }} + replicas: {{ .Values.storage.consensus.replicas }} + partitionsPerCluster: {{ .Values.storage.consensus.partitionsPerCluster }} +{{- else if eq .Values.storage.consensus.type "cache" }} +apiVersion: storage.cloud.atomix.io/v1beta1 +kind: CacheStorageClass +metadata: + name: {{ $name }} + namespace: {{ .Release.Namespace }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + image: {{ default "atomix/cache-storage-node:v0.4.0" .Values.storage.consensus.image }} + imagePullPolicy: {{ .Values.storage.consensus.imagePullPolicy }} +{{- else }} +{{ fail ( printf "%s is not a valid storage type" .Values.storage.consensus.type ) }} +{{- end }} +{{- end }} diff --git a/onos-e2sub/templates/deployment.yaml b/onos-e2sub/templates/deployment.yaml new file mode 100644 index 00000000..4446771f --- /dev/null +++ b/onos-e2sub/templates/deployment.yaml @@ -0,0 +1,110 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "onos-e2sub.fullname" . }} + labels: + {{- include "onos-e2sub.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + name: {{ template "onos-e2sub.fullname" . }} + app: onos + type: e2sub + resource: {{ template "onos-e2sub.fullname" . }} + {{- include "onos-e2sub.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + name: {{ template "onos-e2sub.fullname" . }} + app: onos + type: e2sub + resource: {{ template "onos-e2sub.fullname" . }} + {{- include "onos-e2sub.selectorLabels" . | nindent 8 }} + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: {{ include "onos-e2sub.imagename" . | quote }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "-caPath=/etc/onos/certs/tls.cacrt" + - "-keyPath=/etc/onos/certs/tls.key" + - "-certPath=/etc/onos/certs/tls.crt" + - "-sctpport={{ .Values.sctp.port | default 36421 }}" + ports: + - name: grpc + containerPort: {{ .Values.grpc.port }} + env: + # *_NAMESPACE and *_NAME environment variables are recognized by onos-lib-go utilities. + # These variables should always be defined. + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: SERVICE_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SERVICE_NAME + value: {{ template "onos-ric.fullname" . }} + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + startupProbe: + tcpSocket: + port: 5150 + periodSeconds: 5 + failureThreshold: 60 + readinessProbe: + tcpSocket: + port: 5150 + initialDelaySeconds: 10 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 5150 + initialDelaySeconds: 10 + periodSeconds: 10 + volumeMounts: + - name: secret + mountPath: /etc/onos/certs + readOnly: true + - name: config + mountPath: /etc/onos/config + readOnly: true + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: secret + secret: + secretName: {{ template "onos-e2sub.fullname" . }}-secret + - name: config + configMap: + name: {{ template "onos-e2sub.fullname" . }}-config + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/onos-e2sub/templates/secret.yaml b/onos-e2sub/templates/secret.yaml new file mode 100644 index 00000000..129fd3a5 --- /dev/null +++ b/onos-e2sub/templates/secret.yaml @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "onos-e2sub.fullname" . }}-secret + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + {{ $root := . }} + {{ range $path, $bytes := .Files.Glob "files/certs/tls.*" }} + {{ base $path }}: '{{ $root.Files.Get $path | b64enc }}' + {{ end }} +type: Opaque diff --git a/onos-e2sub/templates/service.yaml b/onos-e2sub/templates/service.yaml new file mode 100644 index 00000000..bf162d86 --- /dev/null +++ b/onos-e2sub/templates/service.yaml @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "onos-e2sub.fullname" . }} + labels: + app: {{ template "onos-e2sub.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "onos-e2sub.labels" . | nindent 4 }} +spec: + type: ClusterIP + selector: + name: {{ template "onos-e2sub.fullname" . }} + app: onos + type: e2t + resource: {{ template "onos-e2sub.fullname" . }} + {{- include "onos-e2sub.selectorLabels" . | nindent 4 }} + ports: + - name: grpc + port: 5150 + - name: exporter + port: 7001 +--- +{{- if .Values.service.external.nodePort }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "onos-e2sub.fullname" . }}-external + labels: + app: {{ template "onos-e2sub.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "onos-e2sub.labels" . | nindent 4 }} +spec: + type: NodePort + selector: + name: {{ template "onos-e2sub.fullname" . }} + app: onos + type: e2t + resource: {{ template "onos-e2sub.fullname" . }} + {{- include "onos-e2sub.selectorLabels" . | nindent 4 }} + ports: + - name: exporter + port: 7001 + nodePort: {{ .Values.service.external.nodePort }} + protocol: TCP +{{- end }} diff --git a/onos-e2sub/values.yaml b/onos-e2sub/values.yaml new file mode 100644 index 00000000..1219f292 --- /dev/null +++ b/onos-e2sub/values.yaml @@ -0,0 +1,82 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +# Default values for onos-e2t. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +global: + image: + registry: "" + tag: "" + storage: + controller: "" + config: + name: "" + +replicaCount: 1 + +image: + registry: "" + repository: onosproject/onos-e2sub + tag: v0.6.1 + pullPolicy: IfNotPresent + pullSecrets: [] + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "onos-e2t" + +sctp: + port: 36421 + +grpc: + port: 5150 + +storage: + controller: "atomix-controller.kube-system.svc.cluster.local:5679" + consensus: + enabled: true + name: "" + type: raft + image: "" + imagePullPolicy: IfNotPresent + partitions: 1 + replicas: 1 + partitionsPerCluster: 1 + +service: + # TODO: External NodePort service should be disabled by default + external: + nodePort: + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +logging: + loggers: + root: + level: info + output: + stdout: + sink: stdout + sinks: + stdout: + type: stdout + stdout: {}