From bd1c1916d906a894dbc0c1fd1245bf3d4735371b Mon Sep 17 00:00:00 2001 From: DR695H Date: Fri, 9 Aug 2019 15:52:42 -0400 Subject: splitting out light httpd Issue-ID: TEST-192 Change-Id: I76d238d743a3653b332fef37fd50520d79bcf314 Signed-off-by: DR695H --- Chart.yaml | 2 +- resources/config/lighttpd/authorization | 1 + resources/config/lighttpd/lighttpd.conf | 41 +++++++ resources/lighttpd/index.html | 192 ++++++++++++++++++++++++++++++++ templates/configmap.yaml | 26 +++++ templates/deployment.yaml | 91 ++++++++++++++- values.yaml | 12 +- 7 files changed, 358 insertions(+), 7 deletions(-) create mode 100644 resources/config/lighttpd/authorization create mode 100644 resources/config/lighttpd/lighttpd.conf create mode 100644 resources/lighttpd/index.html diff --git a/Chart.yaml b/Chart.yaml index 7dbed54..e9915ab 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -14,5 +14,5 @@ apiVersion: v1 description: A helm Chart for kubernetes-ONAP Robot -name: robot +name: integration version: 5.0.0 diff --git a/resources/config/lighttpd/authorization b/resources/config/lighttpd/authorization new file mode 100644 index 0000000..b254e65 --- /dev/null +++ b/resources/config/lighttpd/authorization @@ -0,0 +1 @@ +test:test diff --git a/resources/config/lighttpd/lighttpd.conf b/resources/config/lighttpd/lighttpd.conf new file mode 100644 index 0000000..03d2340 --- /dev/null +++ b/resources/config/lighttpd/lighttpd.conf @@ -0,0 +1,41 @@ +server.document-root = "/var/opt/ONAP/html/" + +server.port = 99 + +server.username = "lighttpd" +server.groupname = "lighttpd" + +dir-listing.activate = "disable" + +alias.url = ( "/logs/" => "/share/logs/" ) +$HTTP["url"] =~ "^/logs/" { + dir-listing.activate = "enable" +} + +mimetype.assign = ( + ".log" => "text/plain", + ".txt" => "text/plain", + ".png" => "image/png", + ".html" => "text/html", + ".xml" => "text/xml" +) + +static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc", ".cgi" ) +index-file.names = ( "index.html" ) + +server.modules += ( "mod_auth" ) +server.modules += ( "mod_alias" ) +server.modules += ( "mod_compress" ) +auth.debug = 2 +auth.backend = "plain" +auth.backend.plain.userfile = "/etc/lighttpd/authorization" +auth.require = ( "/" => +( +"method" => "basic", +"realm" => "Password protected area", +"require" => "valid-user" +) +) + +# compress.cache-dir = "/var/lib/lighttpd/cache/compress" +compress.filetype = ("application/x-javascript", "text/css", "text/html", "text/plain") diff --git a/resources/lighttpd/index.html b/resources/lighttpd/index.html new file mode 100644 index 0000000..f086f23 --- /dev/null +++ b/resources/lighttpd/index.html @@ -0,0 +1,192 @@ + + Quicklinks To Running Instances + + + + +

The Portal

+ + The portal is the entry point to design/provision/operate ONAP. From there you can get to SDC, VID and Policy portals. + + The portal can be found at:

+ + Portal +

+ One requires role based user names and passwords to receive the full portal functionality. In the demo setup we pre provisioned: +

+

+

+ the password for all of them is: demo123456! + +

/etc/hosts or C:\Windows\system32\drivers\etc\hosts +
+
+portal-app.onap portal portal.api.simpledemo.onap.org
+N/A sdc sdc.api.simpledemo.onap.org
+vid.onap vid vid.api.simpledemo.onap.org
+pdp.onap policy policy.api.simpledemo.onap.org
+aai.onap aai1 aai.api.simpledemo.onap.org
+
+10.0.10.1 robot
+appc.onap appc
+so.onap  so
+sdnc.onap sdnc
+msb-iag.onap multi-service
+dcae-healthcheck.onap dcae
+message-router.onap message-router
+clamp.onap clamp
+
+portal-app.onap vm-portal
+N/A vm-sdc
+vid.onap vm-vid
+pdp.onap vm-policy
+aai.onap vm-aai1
+10.0.10.1 vm-robot
+appc.onap vm-appc
+so.onap  vm-so
+sdnc.onap vm-sdnc
+msb-iag.onap vm-multi-service
+dcae-healthcheck.onap vm-dcae
+message-router.onap vm-message-router
+clamp.onap vm-clamp
+
+	
+ +

The Reality

+ + As everything should go through the portal there are many subsystems which have there own GUI or API which come in very handy when debugging things. Here the most important once. + +

Testing

+ +

Robot Logs

+ + Robot Logs + +

Robot vm_properties.py for local testing

+
+ +

SDN-C

+ + Controller with admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U

+ + To sign up

+ Admin

+ +

App-C

+ + Controller with admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U

+ +

Policy

+ + Not working. : + Healthcheck

+ +

SO

+ + JBOSS GUI with admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U

+ + Camunda GUI with admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U

+ +

DCAE

+ +

General GUIs

+ DCAE Controller + This might show up empty in a web browser as no content type is set in the response. If that's the case use curl:

+ + curl http://console:ZjJkYjllMjljMTI2M2Iz@dcae-healthcheck.onap:9998/resources

+ + CDAP GUI

+ +

DCAE internal Message Router

+ + Topics

+ + MR topic for collector to TCA

+ + MR topic for TCA alert to Policy

+ +

Message Router used between core components

+ + List of Topics

+ +

Topics of Interest

+ + For topics without authentication one can monitor the traffic on a topic with:

+ + http://message-router.onap:3904/events/PUT_TOPIC_HERE/group1/C1?timeout=5000

+ + some important once listed below.

+ +

+ +

SSH to VM

+ + The following links will open a shell and ssh to the various running VMs (at least on a Mac). It assumes that the .ssh/config file has been set appropriately and /etc/hosts has been updated to the running instance.

+ + AAI1

+ Policy

+ SDC

+ Portal

+ DCAE

+ APP-C

+ SO

+ SDN-C

+ VID

+ Message Router

+ Robot Framework for testing

+ DNS server for management network

+ + Inside the VM you can list the docker containers by typing:

+ docker ps

+ and can get a shell prompt by executing the bash command. + For example:

docker exec -it onapete_container bash

+ + diff --git a/templates/configmap.yaml b/templates/configmap.yaml index da50934..170ee56 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -24,3 +24,29 @@ metadata: heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/eteshare/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-lighttpd-configmap + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/config/lighttpd/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-lighttpd-index-configmap + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/lighttpd/*").AsConfig . | indent 2 }} \ No newline at end of file diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 7b0c140..255017b 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -31,11 +31,9 @@ spec: release: {{ .Release.Name }} spec: containers: - - name: {{ include "common.name" . }} + - name: {{ include "common.name" . }}-robot image: "{{ include "common.repository" . }}/{{ .Values.image }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - ports: - - containerPort: {{ .Values.service.internalPort }} {{ if .Values.liveness.enabled }} livenessProbe: tcpSocket: @@ -58,8 +56,85 @@ spec: mountPath: /share/config - name: robot-logs mountPath: /share/logs + - name: vnf-assets + mountPath: /share/assets resources: {{ include "common.resources" . }} + - name: {{ include "common.name" . }}-web + image: "{{ .Values.lighthttpdImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + tty: true + {{ 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 }} + volumeMounts: + - name: localtime + mountPath: /etc/localtime + readOnly: true + - name: robot-eteshare + mountPath: /var/www/localhost/htdocs/robot_properties.py + subPath: robot_properties.py + - name: robot-lighttpd-index + mountPath: /var/www/localhost/htdocs/index.html + subPath: index.html + - name: robot-logs + mountPath: /share/logs + - name: robot-lighttpd-config + mountPath: /etc/lighttpd/ + resources: +{{ include "common.resources" . }} + - name: {{ include "common.name" . }}-debug + image: "{{ .Values.debugImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + {{ if .Values.liveness.enabled }} + livenessProbe: + exec: + command: + - ls + - / + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} + readinessProbe: + exec: + command: + - ls + - / + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumeMounts: + - name: robot-logs + mountPath: /share/logs + resources: +{{ include "common.resources" . }} + initContainers: + - name: git-sync + image: {{ .Values.gitInitImage }} + volumeMounts: + - mountPath: /git/tmp + name: vnf-assets + env: + - name: GIT_SYNC_REPO + value: "{{ .Values.vnfAssetLocation }}" + - name: GIT_SYNC_ONE_TIME + value: "true" + - name: GIT_SYNC_REF + value: "{{ .Values.demoArtifactsVersion }}" + - name: GIT_SYNC_ROOT + value: "/git/tmp" + securityContext: + runAsUser: 0 {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} @@ -86,5 +161,15 @@ spec: configMap: name: {{ include "common.fullname" . }}-eteshare-configmap defaultMode: 0755 + - name: robot-lighttpd-config + configMap: + name: {{ include "common.fullname" . }}-lighttpd-configmap + defaultMode: 0755 + - name: robot-lighttpd-index + configMap: + name: {{ include "common.fullname" . }}-lighttpd-index-configmap + defaultMode: 0755 + - name: vnf-assets + emptyDir: {} imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/values.yaml b/values.yaml index 39989d3..a3c2ae4 100644 --- a/values.yaml +++ b/values.yaml @@ -26,6 +26,9 @@ image: onap/testsuite:1.5.0-STAGING-latest pullPolicy: Always ubuntuInitImage: oomk8s/ubuntu-init:2.0.0 +lighthttpdImage: sebp/lighttpd:1.4.54-r0 +gitInitImage: googlecontainer/git-sync:v3.1.2 +debugImage: ubuntu:16.04 # flag to enable debugging - application support required debugEnabled: false @@ -47,6 +50,9 @@ demoArtifactsRepoUrl: "https://nexus.onap.org/content/repositories/releases" # Openstack medium sized flavour name. Maps GLOBAL_INJECTED_VM_FLAVOR openStackFlavourMedium: "m1.medium" +# VNF Asset Location - git repo with assets +vnfAssetLocation: https://gerrit.onap.org/r/demo.git + ################# Openstack .RC Parameters ################################333 # KEYSTONE Version 3 Required for Rocky and beyond # Openstack Keystone API version. Valid values are [ v2.0, v3 ]. Maps to GLOBAL_INJECTED_OPENSTACK_KEYSTONE_API_VERSION @@ -228,12 +234,12 @@ readiness: periodSeconds: 10 service: - name: robot + name: integration type: NodePort portName: httpd externalPort: 88 - internalPort: 88 - nodePort: "09" + internalPort: 99 + nodePort: "99" ingress: enabled: false -- cgit 1.2.3-korg