Helm Chart Standardization Sniro-Emulator(Mock) 75/41675/7
authorvaibhav <vaibhav.chopra@amdocs.com>
Mon, 9 Apr 2018 07:03:53 +0000 (07:03 +0000)
committervaibhav_16dec <vaibhav.chopra@amdocs.com>
Mon, 14 May 2018 10:22:01 +0000 (10:22 +0000)
This task also includes renaming of mock project into sniro-emulator

Issue-ID: OOM-741

Change-Id: Ib0352f7ecb10019f940c571de073dc0af7056ee5
Signed-off-by: vaibhav <vaibhav.chopra@amdocs.com>
13 files changed:
kubernetes/mock/templates/all-services.yaml [deleted file]
kubernetes/mock/templates/sniroemulator-deployment.yaml [deleted file]
kubernetes/onap/requirements.yaml
kubernetes/onap/resources/environments/dev.yaml
kubernetes/onap/resources/environments/disable-allcharts.yaml
kubernetes/onap/values.yaml
kubernetes/sniro-emulator/.helmignore [new file with mode: 0644]
kubernetes/sniro-emulator/Chart.yaml [moved from kubernetes/mock/Chart.yaml with 89% similarity]
kubernetes/sniro-emulator/requirements.yaml [moved from kubernetes/mock/values.yaml with 71% similarity]
kubernetes/sniro-emulator/templates/NOTES.txt [new file with mode: 0644]
kubernetes/sniro-emulator/templates/deployment.yaml [new file with mode: 0644]
kubernetes/sniro-emulator/templates/service.yaml [new file with mode: 0644]
kubernetes/sniro-emulator/values.yaml [new file with mode: 0644]

diff --git a/kubernetes/mock/templates/all-services.yaml b/kubernetes/mock/templates/all-services.yaml
deleted file mode 100644 (file)
index 4c566ee..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright © 2017 Amdocs, Bell Canada
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#{{ if not .Values.disableMockSniroEmulator }}
-apiVersion: v1
-kind: Service
-metadata:
-  name: sniro-emulator
-  namespace: "{{ .Values.nsPrefix }}"
-  labels:
-    app: sniro-emulator
-spec:
-  type: NodePort
-  ports:
-  - port: 80
-    nodePort: {{ .Values.nodePortPrefix }}88
-    targetPort: 9999
-    protocol: TCP
-    name: http
-  selector:
-    app: sniro-emulator
-#{{ end }}
\ No newline at end of file
diff --git a/kubernetes/mock/templates/sniroemulator-deployment.yaml b/kubernetes/mock/templates/sniroemulator-deployment.yaml
deleted file mode 100644 (file)
index cd0da9f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright © 2017 Amdocs, Bell Canada
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#{{ if not .Values.disableMockSniroEmulator }}
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: sniro-emulator
-  namespace: "{{ .Values.nsPrefix }}"
-spec:
-  selector:
-    matchLabels:
-      app: sniro-emulator
-  replicas: 1
-  template:
-    metadata:
-      labels:
-        app: sniro-emulator
-        name: sniro-emulator
-    spec:
-      containers:
-      - image: "{{ .Values.image.onapmock }}:{{ .Values.image.tag }}"
-        imagePullPolicy: {{ .Values.pullPolicy }}
-        name: sniro-emulator
-        ports:
-        - containerPort: 9999
-        args: ["--verbose"]
-      imagePullSecrets:
-      - name: "{{ .Values.nsPrefix }}-docker-registry-key"
-#{{ end }}
index 03ee94d..97bcea4 100644 (file)
@@ -60,10 +60,10 @@ dependencies:
     version: ~2.0.0
     repository: '@local'
     condition: log.enabled
-  - name: mock
-    version: ~0.1.0
+  - name: sniro-emulator
+    version: ~2.0.0
     repository: '@local'
-    condition: mock.enabled
+    condition: sniro-emulator.enabled
   - name: msb
     version: ~2.0.0
     repository: '@local'
index 44245ed..e8d1eb1 100644 (file)
@@ -70,7 +70,7 @@ esr:
   enabled: false
 log:
   enabled: false
-mock:
+sniro-emulator:
   enabled: false
 oof:
   enabled: false
index 819cc7a..0f669be 100644 (file)
@@ -45,7 +45,7 @@ esr:
   enabled: false
 log:
   enabled: false
-mock:
+sniro-emulator:
   enabled: false
 msb:
   enabled: false
index cffff73..d0b0663 100644 (file)
@@ -85,9 +85,7 @@ esr:
   enabled: true
 log:
   enabled: true
-message-router:
-  enabled: true
-mock:
+sniro-emulator:
   enabled: true
 oof:
   enabled: true
diff --git a/kubernetes/sniro-emulator/.helmignore b/kubernetes/sniro-emulator/.helmignore
new file mode 100644 (file)
index 0000000..f0c1319
--- /dev/null
@@ -0,0 +1,21 @@
+# 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
similarity index 89%
rename from kubernetes/mock/Chart.yaml
rename to kubernetes/sniro-emulator/Chart.yaml
index e5d38b6..8916167 100644 (file)
@@ -13,6 +13,6 @@
 # limitations under the License.
 
 apiVersion: v1
-description: A Helm chart for Kubernetes
-name: mock
-version: 0.1.0
+description: ONAP Mock Sniro Emulator
+name: sniro-emulator
+version: 2.0.0
similarity index 71%
rename from kubernetes/mock/values.yaml
rename to kubernetes/sniro-emulator/requirements.yaml
index 809ad90..f639633 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-nsPrefix: onap
-pullPolicy: Always
-nodePortPrefix: 302
-image:
-  onapmock: nexus3.onap.org:10001/onap/sniroemulator
-  tag: latest
+dependencies:
+  - name: common
+    version: ~2.0.0
+    # local reference to common chart, as it is
+    # a part of this chart's package and will not
+    # be published independently to a repo (at this point)
+    repository: '@local'
diff --git a/kubernetes/sniro-emulator/templates/NOTES.txt b/kubernetes/sniro-emulator/templates/NOTES.txt
new file mode 100644 (file)
index 0000000..409d59e
--- /dev/null
@@ -0,0 +1,34 @@
+{{/*
+# Copyright © 2017 Amdocs, AT&T, Bell Canada
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+1. Get the application URL by running these commands:
+{{- if .Values.ingress.enabled }}
+{{- range .Values.ingress.hosts }}
+  http://{{ . }}
+{{- end }}
+{{- else if contains "NodePort" .Values.service.type }}
+  export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }})
+  export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
+  echo http://$NODE_IP:$NODE_PORT
+{{- else if contains "LoadBalancer" .Values.service.type }}
+     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
+           You can watch the status of by running 'kubectl get svc -w {{ include "common.name" . }}'
+  export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
+  echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
+{{- else if contains "ClusterIP" .Values.service.type }}
+  export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ .Chart.Name }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+  echo "Visit http://127.0.0.1:8080 to use your application"
+  kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }}
+{{- end }}
diff --git a/kubernetes/sniro-emulator/templates/deployment.yaml b/kubernetes/sniro-emulator/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..da5266a
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright © 2017 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: {{ include "common.fullname" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.name" . }}
+        release: {{ .Release.Name }}
+    spec:
+      containers:
+      - name: {{ include "common.name" . }}
+        image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        ports:
+        - containerPort: {{ .Values.service.internalPort }}
+        {{ if .Values.liveness.enabled }}
+        livenessProbe:
+          tcpSocket:
+            port: {{ .Values.service.internalPort }}
+          initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
+          periodSeconds: {{ .Values.liveness.periodSeconds }}
+        {{ end }}
+        readinessProbe:
+          tcpSocket:
+            port: {{ .Values.service.internalPort }}
+          initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
+          periodSeconds: {{ .Values.readiness.periodSeconds }}
+          resources:
+{{ toYaml .Values.resources | indent 12 }}
+        {{- if .Values.nodeSelector }}
+        nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 10 }}
+        {{- end -}}
+        {{- if .Values.affinity }}
+        affinity:
+{{ toYaml .Values.affinity | indent 10 }}
+        {{- end }}
+      imagePullSecrets:
+      - name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/sniro-emulator/templates/service.yaml b/kubernetes/sniro-emulator/templates/service.yaml
new file mode 100644 (file)
index 0000000..73edbd9
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright © 2017 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "common.servicename" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    {{if eq .Values.service.type "NodePort" -}}
+    - port: {{ .Values.service.externalPort }}
+      targetPort: {{ .Values.service.internalPort }}
+      nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
+      name: {{ .Values.service.portName | default "http" }}
+    {{- else -}}
+    - port: {{ .Values.service.externalPort }}
+      targetPort: {{ .Values.service.internalPort }}
+      name: {{ .Values.service.portName | default "http" }}
+    {{- end}}
+  selector:
+    app: {{ include "common.name" . }}
+    release: {{ .Release.Name }}
diff --git a/kubernetes/sniro-emulator/values.yaml b/kubernetes/sniro-emulator/values.yaml
new file mode 100644 (file)
index 0000000..3896960
--- /dev/null
@@ -0,0 +1,76 @@
+# Copyright © 2017 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#################################################################
+# Global configuration defaults.
+#################################################################
+global: # global defaults
+  nodePortPrefix: 302
+
+# application image
+repository: nexus3.onap.org:10001
+image: onap/sniroemulator
+pullPolicy: IfNotPresent
+
+# flag to enable debugging - application support required
+debugEnabled: false
+
+# default number of instances
+replicaCount: 1
+
+nodeSelector: {}
+
+affinity: {}
+
+# probe configuration parameters
+liveness:
+  initialDelaySeconds: 10
+  periodSeconds: 10
+  # necessary to disable liveness probe when setting breakpoints
+  # in debugger so K8s doesn't restart unresponsive container
+  enabled: true
+
+readiness:
+  initialDelaySeconds: 10
+  periodSeconds: 10
+
+service:
+  type: NodePort
+  name: sniro-emulator
+  internalPort: 9999
+  externalPort: 80
+  nodePort: 88
+  portName: httpd
+
+ingress:
+  enabled: false
+
+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:'.
+  #
+  # Example:
+  # Configure resource requests and limits
+  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
+  # Minimum memory for development is 2 CPU cores and 4GB memory
+  # Minimum memory for production is 4 CPU cores and 8GB memory
+#resources:
+#  limits:
+#    cpu: 2
+#    memory: 4Gi
+#  requests:
+#    cpu: 2
+#    memory: 4Gi