diff options
author | Arthur Martella <arthur.martella.1@att.com> | 2019-03-15 11:56:54 -0400 |
---|---|---|
committer | Arthur Martella <arthur.martella.1@att.com> | 2019-03-15 11:56:54 -0400 |
commit | 99c4495bd4eb4b1bb01cc483f5d9ade58843d91a (patch) | |
tree | ceb9ed28f275b9514eca11cc0d9196a0b7c30222 /engine/kubernetes | |
parent | 2f7fe5df5de5014f2d54422eccc8bc2a4e13fd8e (diff) |
Initial upload of F-GPS seed code 1/21
Includes:
Base license for project and engine
Engine dockerfile
Engine sample helm chart
Engine sample config directory
Change-Id: I034927aed57d8f48de44a0aae9be34e46d7db5ac
Issue-ID: OPTFRA-440
Signed-off-by: arthur.martella.1@att.com
Diffstat (limited to 'engine/kubernetes')
7 files changed, 347 insertions, 0 deletions
diff --git a/engine/kubernetes/org-onap-fgps-dev/.helmignore b/engine/kubernetes/org-onap-fgps-dev/.helmignore new file mode 100755 index 0000000..f0c1319 --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/.helmignore @@ -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 diff --git a/engine/kubernetes/org-onap-fgps-dev/Chart.yaml b/engine/kubernetes/org-onap-fgps-dev/Chart.yaml new file mode 100755 index 0000000..2749f1a --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/Chart.yaml @@ -0,0 +1,19 @@ +# Copyright © 2019 AT&T +# +# 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 +appVersion: "1.0" +description: A Helm chart for valet engine Kubernetes +name: valetengine +version: 1.0.0 diff --git a/engine/kubernetes/org-onap-fgps-dev/resources/config/solver.json b/engine/kubernetes/org-onap-fgps-dev/resources/config/solver.json new file mode 100755 index 0000000..62f179e --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/resources/config/solver.json @@ -0,0 +1,72 @@ +{
+ "engine": {
+ "id": "valet01",
+ "timeout": 300,
+ "dha": "false",
+ "ek": "123"
+ },
+ "logging": {
+ "path": "{{.Values.logging.path}}",
+ "name": "{{.Values.logging.name}}",
+ "format": "{{.Values.logging.format}}",
+ "size": 10000000,
+ "level": "{{.Values.logging.level}}",
+ "lk": "234"
+ },
+ "db": {
+ "mode": "music",
+ "keyspace": "{{.Values.db.keyspace}}",
+ "requests_table": "{{.Values.db.requests_table}}",
+ "results_table": "{{.Values.db.results_table}}",
+ "group_rules_table": "{{.Values.db.group_rules_table}}",
+ "groups_table": "{{.Values.db.groups_table}}",
+ "stacks_table": "{{.Values.db.stacks_table}}",
+ "resources_table": "{{.Values.db.resources_table}}",
+ "stack_id_map_table": "{{.Values.db.stack_id_map_table}}",
+ "regions_table": "{{.Values.db.regions_table}}",
+ "dk": "789"
+ },
+ "music": {
+ "hosts": [ "{{.Values.music.host1}}", "{{.Values.music.host2}}", "{{.Values.music.host3}}" ],
+ "port": "8080",
+ "path": "/MUSIC/rest/v2",
+ "timeout": 10,
+ "retries": 3,
+ "replication_factor": 3,
+ "lock_timeout": 300,
+ "userid": "{{.Values.music.userid}}",
+ "password": "{{.Values.music.password}}",
+ "namespace": "{{.Values.music.namespace}}"
+ },
+ "compute": {
+ "mode": "nova",
+ "default_cpu_allocation_ratio": 1.0,
+ "default_ram_allocation_ratio": 1.0,
+ "default_disk_allocation_ratio": 1.0,
+ "batch_sync_interval": 3600
+ },
+ "nova": {
+ "project_name": "{{.Values.nova.project_name}}",
+ "admin_view_username": "{{.Values.nova.admin_view_username}}",
+ "admin_username": "{{.Values.nova.admin_username}}",
+ "admin_view_password": "{{.Values.nova.admin_view_password}}",
+ "admin_password": "{{.Values.nova.admin_password}}"
+ },
+ "topology": {
+ "mode": "{{.Values.topology.mode}}"
+ },
+ "naming": {
+ "rack_codes": [
+ "r"
+ ],
+ "host_codes": [
+ "a",
+ "c",
+ "u",
+ "f",
+ "o",
+ "p",
+ "s"
+ ]
+ }
+}
diff --git a/engine/kubernetes/org-onap-fgps-dev/templates/configmap.yaml b/engine/kubernetes/org-onap-fgps-dev/templates/configmap.yaml new file mode 100755 index 0000000..25c8816 --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/templates/configmap.yaml @@ -0,0 +1,21 @@ +# Copyright © 2019 AT&T +# +# 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: ConfigMap +metadata: + name: engine-configs + namespace: org-onap-fgps-dev +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/engine/kubernetes/org-onap-fgps-dev/templates/deployment.yaml b/engine/kubernetes/org-onap-fgps-dev/templates/deployment.yaml new file mode 100755 index 0000000..aebeacc --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/templates/deployment.yaml @@ -0,0 +1,76 @@ +# Copyright © 2019 AT&T +# +# 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: {{ .Chart.Name }} + namespace: {{ .Values.global.ns }} + labels: + app: {{ .Chart.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ .Chart.Name }} + release: {{ .Release.Name }} + spec: + serviceAccount: "default" + volumes: + - name: engine-volume + configMap: + name: engine-configs + items: + - key: solver.json + path: solver.json + - name: engine-logs + hostPath: + path: /opt/logs/engine + imagePullSecrets: + - name: pullsecret + initContainers: + - name: init-cont + image: ubuntu:16.04 + command: ['bash', '-c', 'useradd --uid 825 valetu && chown -R valetu /engine'] + volumeMounts: + - mountPath: /engine + name: engine-logs + containers: + - env: + - name: properties + value: solver.json + image: "nexus.onap.org:5100/org.onap.fgps/engine:latest" + imagePullPolicy: Always + name: "engine" + volumeMounts: + - name: engine-volume + mountPath: /opt/config/solver.json + subPath: solver.json + - name: engine-logs + mountPath: /engine + ports: + - containerPort: 80 + protocol: TCP + resources: + requests: + memory: "500Mi" + cpu: "250m" + limits: + memory: "1Gi" + cpu: "500m" + restartPolicy: Always diff --git a/engine/kubernetes/org-onap-fgps-dev/templates/service.yaml b/engine/kubernetes/org-onap-fgps-dev/templates/service.yaml new file mode 100755 index 0000000..8b9d1d0 --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/templates/service.yaml @@ -0,0 +1,41 @@ +# Copyright © 2019 AT&T +# +# 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: {{ .Chart.Name }} + namespace: {{ .Values.global.ns }} + labels: + app: {{ .Chart.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.service.nodePort }} + name: {{ .Values.service.portName }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.portName }} + {{- end}} + selector: + app: {{ .Chart.Name }} + release: {{ .Release.Name }} + diff --git a/engine/kubernetes/org-onap-fgps-dev/values.yaml b/engine/kubernetes/org-onap-fgps-dev/values.yaml new file mode 100755 index 0000000..223f036 --- /dev/null +++ b/engine/kubernetes/org-onap-fgps-dev/values.yaml @@ -0,0 +1,97 @@ +# Copyright © 2019 AT&T +# +# 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: + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + repositoryCred: + user: repo_user@valet.onap.org + password: repo_password + repository: nexus.onap.org:5100 + commonConfigPrefix: engine + ns: org-onap-fgps-dev + image: + filebeat: docker.elastic.co/beats/filebeat:5.5.0 + repository: nexus.onap.org:5100 + name: org.onap.fgps/engine:latest +pullPolicy: Always +nodePortPrefix: 300 +dataRootDir: /dockerdata-nfs +config: + aai: + serviceName: aai.onap.org + port: 8443 + msb: + serviceName: msb-iag + port: 80 + +service: + type: NodePort + name: engine + externalPort: 80 + internalPort: 80 + nodePort: 30632 + portName: engine +ingress: + enabled: false +replicaCount: 1 +liveness: + initialDelaySeconds: 10 + periodSeconds: 10 + enabled: true +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + + +logging: + path: "/engine/" + name: debug1.log + format: "%(asctime)s.%(msecs)03d [%(levelname)-5.5s] [%(name)s] - %(message)s" + size: 10000000 + level: debug + lk: '234' +db: + mode: music + keyspace: pn1 + requests_table: requests + results_table: results + group_rules_table: group_rules + groups_table: groups + stacks_table: stacks + resources_table: resources + stack_id_map_table: stack_id_map + regions_table: regions + dk: '789' +music: + host1: music1.onap.org + host2: music2.onap.org + host3: music3.onap.org + port: '8080' + path: "/MUSIC/rest/v2" + timeout: 10 + retries: 3 + replication_factor: 3 + lock_timeout: 300 + userid: musicuser@onap.org + password: encrypted_music_password + namespace: org.onap.dev.music +nova: + project_name: admin + admin_view_username: openstack_username + admin_username: openstack_username + admin_view_password: encrypted_openstack_password + admin_password: encrypted_openstack_password +topology: + mode: naming
\ No newline at end of file |