diff options
author | Bogumil Zebek <bogumil.zebek@nokia.com> | 2021-04-19 11:23:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-04-19 11:23:03 +0000 |
commit | 20125c90676b92eeb51ff59dc7e9a6feacb939f6 (patch) | |
tree | b19dc4b885f871782743009bc715aad69329d319 /helm/netconf | |
parent | e31795da2484d7012d7ba7d1a34d212af134d64d (diff) | |
parent | 270fd1248a752ffccb3d2041e47083548f313a62 (diff) |
Merge "Create helm chart for netconf server"
Diffstat (limited to 'helm/netconf')
-rw-r--r-- | helm/netconf/Chart.yaml | 33 | ||||
-rw-r--r-- | helm/netconf/README.md | 23 | ||||
-rw-r--r-- | helm/netconf/templates/_helpers.tpl | 53 | ||||
-rw-r--r-- | helm/netconf/templates/deployment.yaml | 56 | ||||
-rw-r--r-- | helm/netconf/templates/service.yaml | 16 | ||||
-rw-r--r-- | helm/netconf/values.yaml | 55 |
6 files changed, 236 insertions, 0 deletions
diff --git a/helm/netconf/Chart.yaml b/helm/netconf/Chart.yaml new file mode 100644 index 0000000..348ffaf --- /dev/null +++ b/helm/netconf/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: netconf-server +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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: 0.1.0 + +# 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. +appVersion: 1.0.0 +dependencies: + - name: zookeeper + version: 6.7.0 + repository: https://charts.bitnami.com/bitnami + - name: kafka + version: 12.17.2 + repository: https://charts.bitnami.com/bitnami + - name: repositoryGenerator + version: ~8.x-0 + repository: '@local'
\ No newline at end of file diff --git a/helm/netconf/README.md b/helm/netconf/README.md new file mode 100644 index 0000000..a8ebd08 --- /dev/null +++ b/helm/netconf/README.md @@ -0,0 +1,23 @@ +# Netconf Server + +# How to deploy on lab + +1. Copy files from helm/netconf to lab + + `scp -i <path to key file .pem> -r <path to>/netconf ubuntu@<RKE_NODE_IP>:<remote path to>/netconf ` +2. Log into the RKE + +3. Update helm dependencies + + `cd ./netconf` + `helm dependency update` + +4. Install chart on your lab + + `helm install netconfserver ./netconf -f oom/kubernetes/registry.yaml` + +# How to use netconf + extarnal port to use netconf server is 30555 + +<https://gerrit.onap.org/r/gitweb?p=integration/simulators/nf-simulator/netconf-server.git;a=blob;f=README.md;h=a093c60336d1e60fd1c5378122c59944975030be;hb=HEAD> +
\ No newline at end of file diff --git a/helm/netconf/templates/_helpers.tpl b/helm/netconf/templates/_helpers.tpl new file mode 100644 index 0000000..1b0ef5c --- /dev/null +++ b/helm/netconf/templates/_helpers.tpl @@ -0,0 +1,53 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "netconf-server.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 "netconf-server.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 "netconf-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "netconf-server.labels" -}} +helm.sh/chart: {{ include "netconf-server.chart" . }} +{{ include "netconf-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "netconf-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "netconf-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + diff --git a/helm/netconf/templates/deployment.yaml b/helm/netconf/templates/deployment.yaml new file mode 100644 index 0000000..15785cd --- /dev/null +++ b/helm/netconf/templates/deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "netconf-server.fullname" . }} + labels: + {{- include "netconf-server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "netconf-server.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "netconf-server.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - env: + - name: KAFKA_HOST_NAME + value: {{ .Values.config.kafka_hostname | quote }} + name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: {{ include "repositoryGenerator.repository" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + livenessProbe: + httpGet: + path: /healthcheck + port: {{ .Values.service.port }} + readinessProbe: + httpGet: + path: /readiness + port: {{ .Values.service.port }} + {{- 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/helm/netconf/templates/service.yaml b/helm/netconf/templates/service.yaml new file mode 100644 index 0000000..e359b81 --- /dev/null +++ b/helm/netconf/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "netconf-server.fullname" . }} + labels: + {{- include "netconf-server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + nodePort: {{ .Values.service.nodePort }} + protocol: TCP + name: {{ .Values.service.port | quote }} + selector: + {{- include "netconf-server.selectorLabels" . | nindent 4 }} diff --git a/helm/netconf/values.yaml b/helm/netconf/values.yaml new file mode 100644 index 0000000..146cd8a --- /dev/null +++ b/helm/netconf/values.yaml @@ -0,0 +1,55 @@ +# Default values for ves-client. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: /onap/org.onap.integration.nfsimulator.netconfserver + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "netconf-server" + + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: {} + +service: + type: NodePort + port: 6555 + nodePort: 30555 + +resources: {} + +zookeeper: + fullnameOverride: "netconf-server-zookeeper" + auth: + enabled: false + allowAnonymousLogin: true + persistence: + enabled: false + +kafka: + fullnameOverride: "netconf-server-kafka" + zookeeper: + enabled: false + externalZookeeper: + servers: "netconf-server-zookeeper" + persistence: + enabled: false + +config: + kafka_hostname: "netconf-server-kafka" + +nodeSelector: {} + +tolerations: [] + +affinity: {} |