From 07b85f621ca4b1969babd79fbc1d86043bb17071 Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Mon, 12 Feb 2024 21:58:45 +0200 Subject: [PATCH 1/9] feat: exposed configuration --- ci-templates/default.yml | 2 +- kubernetes/helm/openslice/Chart.yaml | 2 +- .../{ => keycloak-init}/realm-export.json | 0 .../files/mysql-init/01-databases.sql | 11 +++++ .../src/js/config.js.default | 14 ++++++ .../assets/config/config.prod.default.json | 30 ++++++++++++ .../assets/config/config.theming.default.json | 9 ++++ .../openslice/templates/keycloak-config.yaml | 2 +- .../helm/openslice/templates/manoclient.yaml | 2 +- .../openslice/templates/mysql-config.yaml | 14 +----- .../helm/openslice/templates/oasapi.yaml | 2 +- .../templates/openslice-ingress.yaml | 47 ++++--------------- kubernetes/helm/openslice/templates/osom.yaml | 2 +- .../helm/openslice/templates/osportalapi.yaml | 2 +- .../helm/openslice/templates/osscapi.yaml | 2 +- .../openslice/templates/portalweb-config.yaml | 4 +- .../openslice/templates/tmfweb-config.yaml | 47 ++----------------- kubernetes/helm/openslice/values.yaml | 22 ++++++++- 18 files changed, 109 insertions(+), 105 deletions(-) rename kubernetes/helm/openslice/files/{ => keycloak-init}/realm-export.json (100%) create mode 100644 kubernetes/helm/openslice/files/mysql-init/01-databases.sql create mode 100644 kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js/config.js.default create mode 100644 kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.prod.default.json create mode 100644 kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.json diff --git a/ci-templates/default.yml b/ci-templates/default.yml index 8b0f900..95386c2 100644 --- a/ci-templates/default.yml +++ b/ci-templates/default.yml @@ -7,7 +7,7 @@ stages: .default: variables: - DEFAULT_VERSION: "1.2.0-SNAPSHOT" + DEFAULT_VERSION: "1.0.0-SNAPSHOT" before_script: - | if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then diff --git a/kubernetes/helm/openslice/Chart.yaml b/kubernetes/helm/openslice/Chart.yaml index 94370f1..4b6899e 100644 --- a/kubernetes/helm/openslice/Chart.yaml +++ b/kubernetes/helm/openslice/Chart.yaml @@ -20,4 +20,4 @@ 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.16.0 +appVersion: 1.0.0-SNAPSHOT diff --git a/kubernetes/helm/openslice/files/realm-export.json b/kubernetes/helm/openslice/files/keycloak-init/realm-export.json similarity index 100% rename from kubernetes/helm/openslice/files/realm-export.json rename to kubernetes/helm/openslice/files/keycloak-init/realm-export.json diff --git a/kubernetes/helm/openslice/files/mysql-init/01-databases.sql b/kubernetes/helm/openslice/files/mysql-init/01-databases.sql new file mode 100644 index 0000000..aa16eec --- /dev/null +++ b/kubernetes/helm/openslice/files/mysql-init/01-databases.sql @@ -0,0 +1,11 @@ +# create databases +CREATE DATABASE IF NOT EXISTS `{{ .Values.oscreds.mysql.openslicedb | default "osdb" }}`; +CREATE DATABASE IF NOT EXISTS `{{ .Values.oscreds.mysql.keycloak.database | default "keycloak" }}`; + +# create portal user and grant rights +CREATE USER '{{ .Values.oscreds.mysql.portal.username | default "portaluser" }}'@'localhost' IDENTIFIED BY '{{ .Values.oscreds.mysql.portal.password | default "12345" }}'; +GRANT ALL PRIVILEGES ON *.* TO '{{ .Values.oscreds.mysql.portal.username | default "portaluser" }}'@'%' IDENTIFIED BY '{{ .Values.oscreds.mysql.portal.password | default "12345" }}'; + +# create keycloak user and grant rights +CREATE USER '{{ .Values.oscreds.mysql.keycloak.username | default "keycloak" }}'@'localhost' IDENTIFIED BY '{{ .Values.oscreds.mysql.keycloak.password | default "password" }}'; +GRANT ALL PRIVILEGES ON *.* TO '{{ .Values.oscreds.mysql.keycloak.username | default "keycloak" }}'@'%' IDENTIFIED BY '{{ .Values.oscreds.mysql.keycloak.password | default "password" }}'; diff --git a/kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js/config.js.default b/kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js/config.js.default new file mode 100644 index 0000000..1bb2f0f --- /dev/null +++ b/kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js/config.js.default @@ -0,0 +1,14 @@ +var appConfig = angular.module('portalwebapp.config',[]); + +appConfig.factory('APIEndPointService', function() { + return { + TITLE: "Openslice demo", + WIKI: "{{ .Values.rooturl }}", + BUGZILLA: "{{ .Values.rooturl }}/bugzilla/", + STATUS: "{{ .Values.rooturl }}/", + APIURL: "{{ .Values.rooturl }}", + WEBURL: "{{ .Values.rooturl }}/nfvportal", + APIOAUTHURL: "{{ .Values.rooturl }}/auth/realms/openslice", + APITMFURL: "{{ .Values.rooturl }}/tmf-api/serviceCatalogManagement/v4" + }; +}); diff --git a/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.prod.default.json b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.prod.default.json new file mode 100644 index 0000000..4ef84f6 --- /dev/null +++ b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.prod.default.json @@ -0,0 +1,30 @@ +{ + "TITLE": "Openslice demo", + "PORTALVERSION":"2023-Q3 1.0.0-SNAPSHOT", + "WIKI": "https://openslice.readthedocs.io/en/stable/", + "BUGZILLA": "{BASEURL}/bugzilla/", + "STATUS": "{BASEURL}/", + "WEBURL": "{BASEURL}", + "PORTAL_REPO_APIURL": "{BASEURL}/osapi", + "ASSURANCE_SERVICE_MGMT_APIURL": "{BASEURL}/oas-api", + "APITMFURL": "{BASEURL}/tmf-api", + "OAUTH_CONFIG" : { + "issuer": "{BASEURL}/auth/realms/openslice", + "loginUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/auth", + "tokenEndpoint": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/token", + "redirectUri": "{BASEURL}/redirect", + "logoutUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/logout", + "postLogoutRedirectUri": "{BASEURL}", + + "responseType": "code", + "oidc": false, + "clientId": "osapiWebClientId", + "dummyClientSecret": "secret", + + "requireHttps": false, + "useHttpBasicAuth": true, + "clearHashAfterLogin": false, + + "showDebugInformation": true + } +} diff --git a/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.json b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.json new file mode 100644 index 0000000..99ecd96 --- /dev/null +++ b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.json @@ -0,0 +1,9 @@ +{ +"THEME_ID":"default", +"DEPLOYMENT_LOGO_PATH":"assets/images/logo_clear.png", +"DEFAULT_SERVICE_LOGO_PATH":"assets/images/logo_icon_original.png", +"FAVICON_PATH":"favicon.ico", +"WHO_WE_ARE_HTML":"
openslice.io project | openslice.io
openslice.io an opensource OSS
Openslice demo | http://portal.openslice.io
A portal that allows 5G experimenters to deploy experiment descriptors towards the infrastructure.
Openslice demo wiki | https://openslice.readthedocs.io/en/stable/
A wiki containing project documentation.
Openslice demo Report Issues | http://portal.openslice.io/bugzilla/
Our issue tracking system.
", +"CONNECT_WITH_US_HTML":"
Twitter
Slack
", +"FOOTER_HTML":"
openslice.io has received funding from
5GinFIRE | https://5ginfire.eu/ project from the European Horizon 2020 Programme for research, technological development and demonstration under grant agreement number 732497.
5G-VINNI project | https://5g-vinni.eu/ 5G-VINNI project has received funding from the European Horizon 2020 Programme for research, technological development and demonstration under grant agreement number 815279
Openslice demo running openslice.io version 1.1.0-SNAPSHOT| Data Protection Declaration | © 2019-2021 on behalf of openslice.io
" +} diff --git a/kubernetes/helm/openslice/templates/keycloak-config.yaml b/kubernetes/helm/openslice/templates/keycloak-config.yaml index 5172af3..748008b 100644 --- a/kubernetes/helm/openslice/templates/keycloak-config.yaml +++ b/kubernetes/helm/openslice/templates/keycloak-config.yaml @@ -10,4 +10,4 @@ metadata: namespace: {{ .Release.Namespace }} data: realm-export.json: | - {{- tpl (.Files.Get "files/realm-export.json") . | nindent 4 }} + {{- tpl (.Files.Get "files/keycloak-init/realm-export.json") . | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/manoclient.yaml b/kubernetes/helm/openslice/templates/manoclient.yaml index 8d35e9d..e3f1664 100644 --- a/kubernetes/helm/openslice/templates/manoclient.yaml +++ b/kubernetes/helm/openslice/templates/manoclient.yaml @@ -34,7 +34,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "INFO" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/mysql-config.yaml b/kubernetes/helm/openslice/templates/mysql-config.yaml index ee346b2..ae35d5f 100644 --- a/kubernetes/helm/openslice/templates/mysql-config.yaml +++ b/kubernetes/helm/openslice/templates/mysql-config.yaml @@ -9,15 +9,5 @@ metadata: {{- include "openslice.labels" . | nindent 4 }} name: {{ include "openslice.fullname" . }}-mysql-initdb-config data: - 01-databases.sql: | - # create databases - CREATE DATABASE IF NOT EXISTS `{{ .Values.oscreds.mysql.openslicedb | default "osdb" }}`; - CREATE DATABASE IF NOT EXISTS `{{ .Values.oscreds.mysql.keycloak.database | default "keycloak" }}`; - - # create portal user and grant rights - CREATE USER '{{ .Values.oscreds.mysql.portal.username | default "portaluser" }}'@'localhost' IDENTIFIED BY '{{ .Values.oscreds.mysql.portal.password | default "12345" }}'; - GRANT ALL PRIVILEGES ON *.* TO '{{ .Values.oscreds.mysql.portal.username | default "portaluser" }}'@'%' IDENTIFIED BY '{{ .Values.oscreds.mysql.portal.password | default "12345" }}'; - - # create keycloak user and grant rights - CREATE USER '{{ .Values.oscreds.mysql.keycloak.username | default "keycloak" }}'@'localhost' IDENTIFIED BY '{{ .Values.oscreds.mysql.keycloak.password | default "password" }}'; - GRANT ALL PRIVILEGES ON *.* TO '{{ .Values.oscreds.mysql.keycloak.username | default "keycloak" }}'@'%' IDENTIFIED BY '{{ .Values.oscreds.mysql.keycloak.password | default "password" }}'; + 01-databases.sql: |- + {{ .Files.Get "files/mysql-init/01-databases.sql" | indent 4 }} diff --git a/kubernetes/helm/openslice/templates/oasapi.yaml b/kubernetes/helm/openslice/templates/oasapi.yaml index 5bb458d..c995d89 100644 --- a/kubernetes/helm/openslice/templates/oasapi.yaml +++ b/kubernetes/helm/openslice/templates/oasapi.yaml @@ -54,7 +54,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "INFO" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/openslice-ingress.yaml b/kubernetes/helm/openslice/templates/openslice-ingress.yaml index e7eaa3a..7c5523e 100644 --- a/kubernetes/helm/openslice/templates/openslice-ingress.yaml +++ b/kubernetes/helm/openslice/templates/openslice-ingress.yaml @@ -1,56 +1,25 @@ apiVersion: networking.k8s.io/v1 kind: Ingress -metadata: +metadata: namespace: {{ .Release.Namespace }} labels: app: {{ include "openslice.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{- include "openslice.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.ingress.annotations | nindent 4 }} name: {{ include "openslice.fullname" . }}-openslice-ingress spec: ingressClassName: nginx rules: - http: paths: + {{- range .Values.ingress.paths }} - pathType: Prefix - path: "/tmf-api" + path: "{{ .path }}" backend: service: - name: {{ include "openslice.fullname" . }}-osscapi + name: {{ include "openslice.fullname" . }}-{{ .service }} port: - number: 13082 - - pathType: Prefix - path: "/oas-api" - backend: - service: - name: {{ include "openslice.fullname" . }}-oasapi - port: - number: 13101 - - pathType: Prefix - path: "/auth" - backend: - service: - name: {{ include "openslice.fullname" . }}-keycloak - port: - number: 8080 - - pathType: Prefix - path: "/osapi" - backend: - service: - name: {{ include "openslice.fullname" . }}-osportalapi - port: - number: 13000 - - pathType: Prefix - path: "/nfvportal" - backend: - service: - name: {{ include "openslice.fullname" . }}-portalweb - port: - number: 80 - - pathType: Prefix - path: "/" - backend: - service: - name: {{ include "openslice.fullname" . }}-tmfweb - port: - number: 80 + number: {{ .port }} + {{- end }} diff --git a/kubernetes/helm/openslice/templates/osom.yaml b/kubernetes/helm/openslice/templates/osom.yaml index d5ce50a..30006af 100644 --- a/kubernetes/helm/openslice/templates/osom.yaml +++ b/kubernetes/helm/openslice/templates/osom.yaml @@ -34,7 +34,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "INFO" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/osportalapi.yaml b/kubernetes/helm/openslice/templates/osportalapi.yaml index f22073d..5d78d73 100644 --- a/kubernetes/helm/openslice/templates/osportalapi.yaml +++ b/kubernetes/helm/openslice/templates/osportalapi.yaml @@ -55,7 +55,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "INFO" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/osscapi.yaml b/kubernetes/helm/openslice/templates/osscapi.yaml index 81f7f65..b0f8f0f 100644 --- a/kubernetes/helm/openslice/templates/osscapi.yaml +++ b/kubernetes/helm/openslice/templates/osscapi.yaml @@ -55,7 +55,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework":"INFO", + "logging.level.org.springframework": "{{ .Values.spring.logLevel | default 'INFO' }}", "kroki.serverurl":"{{ .Values.rooturl }}/kroki" } resources: diff --git a/kubernetes/helm/openslice/templates/portalweb-config.yaml b/kubernetes/helm/openslice/templates/portalweb-config.yaml index c4a8a72..10e8ade 100644 --- a/kubernetes/helm/openslice/templates/portalweb-config.yaml +++ b/kubernetes/helm/openslice/templates/portalweb-config.yaml @@ -9,5 +9,5 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{- include "openslice.labels" . | nindent 4 }} data: - config.js: "var appConfig = angular.module('portalwebapp.config',[]);\n\n\nappConfig.factory('APIEndPointService', function() {\n\t return {\t \n\t\tTITLE: \"Openslice demo\",\n\t\tWIKI: \"{{ .Values.rooturl }}\",\n\t\tBUGZILLA: \"{{ .Values.rooturl }}/bugzilla/\",\n\t\tSTATUS: \"{{ .Values.rooturl }}/\",\n\t\tAPIURL: \"{{ .Values.rooturl }}\",\n\t\tWEBURL: \"{{ .Values.rooturl }}/nfvportal\",\n\t\tAPIOAUTHURL: \"{{ .Values.rooturl }}/auth/realms/openslice\",\n\t\tAPITMFURL: \"{{ .Values.rooturl }}/tmf-api/serviceCatalogManagement/v4\"\n\t\t\n\t };\n});\n\n\n" - + config.js: | + {{- .Files.Get "files/org.etsi.osl.portal.web/src/js/config.js" | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/tmfweb-config.yaml b/kubernetes/helm/openslice/templates/tmfweb-config.yaml index c33ccf1..de2067b 100644 --- a/kubernetes/helm/openslice/templates/tmfweb-config.yaml +++ b/kubernetes/helm/openslice/templates/tmfweb-config.yaml @@ -8,45 +8,8 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{- include "openslice.labels" . | nindent 4 }} name: {{ include "openslice.fullname" . }}-tmfweb-config -data: - config.prod.json: |+ - { - "TITLE": "Openslice demo", - "PORTALVERSION":"2023-Q3 1.2.0-SNAPSHOT", - "WIKI": "https://openslice.readthedocs.io/en/stable/", - "BUGZILLA": "{BASEURL}/bugzilla/", - "STATUS": "{{ .Values.rooturl }}/", - "WEBURL": "{BASEURL}", - "PORTAL_REPO_APIURL": "{BASEURL}/osapi", - "ASSURANCE_SERVICE_MGMT_APIURL": "{BASEURL}/oas-api", - "APITMFURL": "{BASEURL}/tmf-api", - "OAUTH_CONFIG" : { - "issuer": "{BASEURL}/auth/realms/openslice", - "loginUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/auth", - "tokenEndpoint": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/token", - "redirectUri": "{BASEURL}/redirect", - "logoutUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/logout", - "postLogoutRedirectUri": "{BASEURL}", - - "responseType": "code", - "oidc": false, - "clientId": "osapiWebClientId", - "dummyClientSecret": "secret", - - "requireHttps": false, - "useHttpBasicAuth": true, - "clearHashAfterLogin": false, - - "showDebugInformation": true - } - } - config.theming.json: |+ - { - "THEME_ID":"default", - "DEPLOYMENT_LOGO_PATH":"assets/images/logo_clear.png", - "DEFAULT_SERVICE_LOGO_PATH":"assets/images/logo_icon_original.png", - "FAVICON_PATH":"favicon.ico", - "WHO_WE_ARE_HTML":"
openslice.io project | openslice.io
openslice.io an opensource OSS
Openslice demo | http://portal.openslice.io
A portal that allows 5G experimenters to deploy experiment descriptors towards the infrastructure.
Openslice demo wiki | https://openslice.readthedocs.io/en/stable/
A wiki containing project documentation.
Openslice demo Report Issues | http://portal.openslice.io/bugzilla/
Our issue tracking system.
", - "CONNECT_WITH_US_HTML":"", - "FOOTER_HTML":"
openslice.io has received funding from
5GinFIRE | https://5ginfire.eu/ project from the European Horizon 2020 Programme for research, technological development and demonstration under grant agreement number 732497.
5G-VINNI project | https://5g-vinni.eu/ 5G-VINNI project has received funding from the European Horizon 2020 Programme for research, technological development and demonstration under grant agreement number 815279
Openslice demo running openslice.io version 1.1.0-SNAPSHOT| Data Protection Declaration | © 2019-2021 on behalf of openslice.io
" - } + data: + config.prod.json: | + {{- .Files.Get "files/org.etsi.osl.tmf.web/src/assets/config/config.prod.json" | nindent 4 }} + config.theming.json: | + {{- .Files.Get "files/org.etsi.osl.tmf.web/src/assets/config/config.theming.json" | nindent 4 }} diff --git a/kubernetes/helm/openslice/values.yaml b/kubernetes/helm/openslice/values.yaml index 24f52b6..e2c73fb 100644 --- a/kubernetes/helm/openslice/values.yaml +++ b/kubernetes/helm/openslice/values.yaml @@ -102,6 +102,7 @@ oscreds: spring: oauthClientSecret: secret + loglevel: INFO mysql: storage: 10Gi @@ -142,8 +143,25 @@ service: port: 80 ingress: - host: chart-example.local - enabled: false + paths: + - path: "/tmf-api" + service: "osscapi" + port: 13082 + - path: "/oas-api" + service: "oasapi" + port: 13101 + - path: "/auth" + service: "keycloak" + port: 8080 + - path: "/osapi" + service: "osportalapi" + port: 13000 + - path: "/nfvportal" + service: "portalweb" + port: 80 + - path: "/" + service: "tmfweb" + port: 80 annotations: {} -- GitLab From db72aea5e4a51e668a6f7155aabd1ff8515dc06b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 15 Feb 2024 13:40:25 +0000 Subject: [PATCH 2/9] feat: added theming scss and removed unneeded configmaps --- .../assets/config/config.theming.default.scss | 149 ++++++++++++++++++ .../templates/portalweb-config-nginx.yaml | 36 ----- .../helm/openslice/templates/portalweb.yaml | 6 - .../templates/tmfweb-config-nginx.yaml | 36 ----- .../openslice/templates/tmfweb-config.yaml | 4 +- .../helm/openslice/templates/tmfweb.yaml | 6 - 6 files changed, 152 insertions(+), 85 deletions(-) create mode 100644 kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.scss delete mode 100644 kubernetes/helm/openslice/templates/portalweb-config-nginx.yaml delete mode 100644 kubernetes/helm/openslice/templates/tmfweb-config-nginx.yaml diff --git a/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.scss b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.scss new file mode 100644 index 0000000..54839f3 --- /dev/null +++ b/kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config/config.theming.default.scss @@ -0,0 +1,149 @@ +/* You can add global styles to this file, and also import other style files */ + +// @import "@angular/material/prebuilt-themes/indigo-pink.css"; + +@import "~@danielmoncada/angular-datetime-picker/assets/style/picker.min.css"; + +/* override bootstrap's 4 blue color */ +$primary: #428bca; +$secondary: #6c6c6c; + +@import "src/assets/config/theming.scss"; + +@import "~bootstrap/scss/bootstrap"; + +// .mat-chip-list-wrapper { +// flex-wrap: nowrap !important; +// } + +.mat-chip { + overflow: unset !important; + white-space: nowrap !important; +} + +* { + font-family: 'Open Sans', sans-serif; + font-weight: 300; +} + +h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { + font-weight: 300 !important; +} + +.btn { + font-weight: 300 !important; +} + +.shadowed { + text-shadow: 4px 4px 6px #aaa; +} + +.shadowed-dark{ + text-shadow: 4px 4px 6px #513838; +} + +.universal-tooltip { + font-size: .9rem; + // width: 450px; +} + +mat-form-field.white-background .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-outline { + background-color: #fff; + border-radius: 5px +} + +mat-form-field { + width: 100%; +} + +.jumbotron.jumbotron-small.jumbotron-list-container { + min-height: 345px; +} + + +.card.card-paper { + border-radius: 12px; + box-shadow: 0 6px 10px -4px rgba(0,0,0,.15); + background-color: #fff; + color: #252422; + margin-bottom: 20px; + position: relative; + border: 0; + transition: box-shadow .2s ease,-webkit-transform .3s cubic-bezier(.34,2,.6,1); + transition: transform .3s cubic-bezier(.34,2,.6,1),box-shadow .2s ease; + transition: transform .3s cubic-bezier(.34,2,.6,1),box-shadow .2s ease,-webkit-transform .3s cubic-bezier(.34,2,.6,1); +} + +.card.card-paper .card-header { + // padding: 15px 15px 0; + padding: 15px; + // border: 0; +} + +.card.card-paper .card-body { + padding: 15px 15px 0px; +} + +.card.card-paper .card-footer { + padding: 0px 15px 15px; + border: 0; + background: transparent; +} + +.card-stats { + font-size: .9rem; +} + +.card-stats i { + font-size: .8em; +} + +.filter-container mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper { + padding: 0; +} + +.table.table-generic { + margin-bottom: 0; + // border: 1px solid #ddd; + // font-family:inherit; +} + +.table.table-generic th { + padding: .5rem; + font-weight: 600; + font-size: 0.9rem; +} + +.table.table-generic td { + vertical-align: middle; + padding: .5rem +} + +.mat-paginator { + font-weight: 600; +} + +mat-panel-title { + font-weight: bold; +} + +.nav-link.active mat-checkbox .mat-checkbox-layout .mat-checkbox-inner-container .mat-checkbox-frame { + border-color:#fff +} + +.nav-link mat-checkbox label { + margin-bottom: 0 ; +} + +.minh-30vh { + min-height: 30vh; +} + +html, body { height: 100%; } +body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } + +@media screen and (min-width: 576px) { + .jumbotron.jumbotron-small { + padding: 2rem; + } + } \ No newline at end of file diff --git a/kubernetes/helm/openslice/templates/portalweb-config-nginx.yaml b/kubernetes/helm/openslice/templates/portalweb-config-nginx.yaml deleted file mode 100644 index 5616103..0000000 --- a/kubernetes/helm/openslice/templates/portalweb-config-nginx.yaml +++ /dev/null @@ -1,36 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: {{ include "openslice.fullname" . }}-portalweb-config-nginx - namespace: {{ .Release.Namespace }} - labels: - app: {{ include "openslice.fullname" . }} - org.etsi.osl.service: portalweb - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" - {{- include "openslice.labels" . | nindent 4 }} -data: - default.conf: |+ - # Expires map - map $sent_http_content_type $expires { - default off; - text/html epoch; - text/css max; - application/json max; - application/javascript max; - ~image/ max; - } - - server { - listen 80; - include /etc/nginx/mime.types; - - server_name {{ .Values.rooturl }}; - location / { - root /usr/share/nginx/html/; - index index.html index.htm; - try_files $uri $uri/ /index.html =404; - } - - expires $expires; - gzip on; - } diff --git a/kubernetes/helm/openslice/templates/portalweb.yaml b/kubernetes/helm/openslice/templates/portalweb.yaml index b97736c..62b5d90 100644 --- a/kubernetes/helm/openslice/templates/portalweb.yaml +++ b/kubernetes/helm/openslice/templates/portalweb.yaml @@ -36,17 +36,11 @@ spec: - name: portalweb-configuration mountPath: /usr/share/nginx/html/nfvportal/js/config.js subPath: config.js - - name: portalweb-configuration-nginx - readOnly: true - mountPath: "/etc/nginx/conf.d" volumes: - name: portalweb-configuration configMap: name: {{ include "openslice.fullname" . }}-portalweb-config defaultMode: 420 - - name: portalweb-configuration-nginx - configMap: - name: {{ include "openslice.fullname" . }}-portalweb-config-nginx restartPolicy: Always --- apiVersion: v1 diff --git a/kubernetes/helm/openslice/templates/tmfweb-config-nginx.yaml b/kubernetes/helm/openslice/templates/tmfweb-config-nginx.yaml deleted file mode 100644 index 501df79..0000000 --- a/kubernetes/helm/openslice/templates/tmfweb-config-nginx.yaml +++ /dev/null @@ -1,36 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: {{ .Release.Namespace }} - labels: - app: {{ include "openslice.fullname" . }} - org.etsi.osl.service: tmfweb - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" - {{- include "openslice.labels" . | nindent 4 }} - name: {{ include "openslice.fullname" . }}-tmfweb-config-nginx -data: - default.conf: |+ - # Expires map - map $sent_http_content_type $expires { - default off; - text/html epoch; - text/css max; - application/json max; - application/javascript max; - ~image/ max; - } - - server { - listen 80; - include /etc/nginx/mime.types; - - server_name {{ .Values.rooturl }}; - location / { - root /usr/share/nginx/html/services; - index index.html index.htm; - try_files $uri $uri/ /index.html =404; - } - - expires $expires; - gzip on; - } diff --git a/kubernetes/helm/openslice/templates/tmfweb-config.yaml b/kubernetes/helm/openslice/templates/tmfweb-config.yaml index de2067b..89a7727 100644 --- a/kubernetes/helm/openslice/templates/tmfweb-config.yaml +++ b/kubernetes/helm/openslice/templates/tmfweb-config.yaml @@ -8,8 +8,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{- include "openslice.labels" . | nindent 4 }} name: {{ include "openslice.fullname" . }}-tmfweb-config - data: +data: config.prod.json: | {{- .Files.Get "files/org.etsi.osl.tmf.web/src/assets/config/config.prod.json" | nindent 4 }} config.theming.json: | {{- .Files.Get "files/org.etsi.osl.tmf.web/src/assets/config/config.theming.json" | nindent 4 }} + config.theming.scss: | + {{- .Files.Get "files/org.etsi.osl.tmf.web/src/assets/config/config.theming.scss" | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/tmfweb.yaml b/kubernetes/helm/openslice/templates/tmfweb.yaml index 81bff65..5ee8974 100644 --- a/kubernetes/helm/openslice/templates/tmfweb.yaml +++ b/kubernetes/helm/openslice/templates/tmfweb.yaml @@ -36,16 +36,10 @@ spec: - name: "tmfweb-configuration" readOnly: true mountPath: "/usr/share/nginx/html/services/assets/config" - - name: "tmfweb-configuration-nginx" - readOnly: true - mountPath: "/etc/nginx/conf.d" volumes: - name: "tmfweb-configuration" configMap: name: {{ include "openslice.fullname" . }}-tmfweb-config - - name: "tmfweb-configuration-nginx" - configMap: - name: {{ include "openslice.fullname" . }}-tmfweb-config-nginx restartPolicy: Always --- apiVersion: v1 -- GitLab From 12f5f76e9cfba17b65f03c6c6d22a6be71662805 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 19 Feb 2024 18:56:17 +0000 Subject: [PATCH 3/9] feat: complete overhaul of the Helm chart documentation --- kubernetes/helm/README.md | 495 +++++++++++++++++++++++++++++++++++++- 1 file changed, 486 insertions(+), 9 deletions(-) diff --git a/kubernetes/helm/README.md b/kubernetes/helm/README.md index d1f1ca1..89fbcbb 100644 --- a/kubernetes/helm/README.md +++ b/kubernetes/helm/README.md @@ -1,12 +1,4 @@ -# OpenSlice Installation Guide with Helm - -## Pre-requisites - -### Required Software - -- A Kubernetes cluster up and running with enough disk to allocate about 12GB of PV storage. (Storage requirements can be changed in the respective PV/PVC templates) -- Helm installed for managing Kubernetes packages. - + +# OpenSlice Installation Guide with Kubernetes + +## Requirements + +### Hardware requirements: + +| **Minimum Hardware Requirements** | **Recomended Hardware Requirements** | +| --------------------------------- | ------------------------------------ | +| 4 CPU cores | 8 CPU cores | +| 8 GB RAM | 16 GB RAM | +| 20 GB storage | 40 GB storage | + +### Software Requirements: + +* **git:** For cloning the project repository. +* **Kubernetes:** A running cluster where OpenSlice will be deployed. +* **Helm:** For managing the deployment of OpenSlice. +* **Ingress Controller:** Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An Ingress controller is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic. You must have an Ingress controller to satisfy an Ingress. + * An Nginx ingress controller is required, which can be installed using [this guide](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-helm/). + * If you use another type of ingress controller, you'll need to modify `[repo-root]/kubernetes/helm/openslice/templates/openslice-ingress.yaml` to conform to your ingress controller's requirements. +* **Network Load Balancer:** Required for exposing the service (e.g., GCP, AWS, Azure, MetalLB). +* **Domain/IP Address:** Necessary for accessing the application. This should be configured in `[repo-root]/kubernetes/helm/openslice/values.yaml` under `rooturl`. + +## Preparing the environment + +### 1. Setting Up A Kubernetes Cluster +Refer to the official Kubernetes documentation for setting up a cluster. Ensure your cluster meets the hardware requirements specified above. + +### 2. Installing Helm +Helm must be installed on your machine to deploy OpenSlice via Helm charts. Follow the [official Helm installation guide](https://helm.sh/docs/intro/install/). + +## Downloading the Project + +### 1. Create a New Folder to Download the Project + +```bash +mkdir openslice +cd openslice +``` + +### 2. Download the Project Code +Clone the project code from the GitLab repository. +**Note:** This process will be simplified once the charts are published in the GitLab registry, requiring only the chart to be pulled. + +```bash +git clone https://labs.etsi.org/rep/osl/code/org.etsi.osl.main.git +cd kubernetes/helm/openslice/ +``` + +### 3. Deploy the Helm Chart + +Before deploying the Helm chart, ensure you have configured the necessary components as detailed in the [Configure Helm Chart Services](#configure-helm-chart-services) section. By default, the `main` branch is selected for deployment. + +We recommend using: +- The **main** branch for the most stable experience. +- The **develop** branch for access to the latest features. For the develop branch installation, it's strongly advisable to follow the [develop documentation](https://osl.etsi.org/documentation/develop/deployment/). + +Deploy OpenSlice with Helm: + +```bash +helm install myopenslice . --namespace openslice --create-namespace +``` + +## Configure Helm Chart Services + +When deploying OpenSlice with Helm, service configurations are handled through the `values.yaml` file. This file allows you to define all necessary configurations for your deployment, including database credentials, service URLs, and logging levels. Below are examples of how to configure your services in Helm based on your provided values. + +### Configuring Services + +#### 1. Database Configuration + +To configure MySQL and other related services, you can directly set the values in your `values.yaml` file under the `oscreds` and `mysql` sections. For example: + +```yaml +oscreds: + mysql: + username: "root" + password: "letmein" + openslicedb: "osdb" + keycloak: + database: "keycloak" + username: "keycloak" + password: "password" + adminpassword: "keycloakadminpass" + portal: + database: "osdb" + username: "portaluser" + password: "12345" +``` + +#### 2. External Services Configuration + +For configuring external services like Bugzilla and CentralLog, specify their URLs and credentials in the `values.yaml` file: + +```yaml +bugzillaurl: "example.com:443/bugzilla" +bugzillakey: "VH2Vw0iI5aYgALFFzVDWqhACwt6Hu3bXla9kSC1Z" +main_operations_product: "Main Site Operations" // this is the default product to issue tickets +centrallogurl: "http://elk_ip:elk_port/index_name/_doc" +``` + +Bugzilla should have the following components under the specified product: + +* NSD Deployment Request: Component used to schedule deployment req +* Onboarding: Issues related to VNF/NSD Onboarding +* Operations Support: Default component for operations support +* Validation: Use to track validation processes of VNFs and NSDs +* VPN Credentials/Access: Used for requesting VPN Credentials/Access + +Also in the 'Main Site Operations' product, a version named 'unspecified' must be created. + +#### 3. Keycloak Configuration + +Keycloak settings, including the database and admin password, are part of the `oscreds.mysql.keycloak` section. If you need to adjust Keycloak-specific settings like realms or client configurations, you'll likely need to customize your Helm chart further or manage these settings directly within Keycloak after deployment. The Keycloak realm configuration that is imported by default can be found under `kubernetes/helm/openslice/files/keycloak-init/realm-export.json`. + +```yaml +oscreds: + mysql: + keycloak: + database: "keycloak" + username: "keycloak" + password: "password" + adminpassword: "keycloakadminpass" +``` + +#### 4. Application and Logging Configuration + +Application-specific configurations, such as OAuth client secrets and logging levels, can be set in the `spring` section: + +```yaml +spring: + oauthClientSecret: "secret" + loglevel: "INFO" +``` + +#### 5. Ingress and Root URL + +To configure the ingress controller and root URL for OpenSlice, update the rooturl field with your ingress load balancer IP or domain. This setting is crucial for external access to your application: + +```yaml +rooturl: "http://openslice.com" # Example domain +# or +rooturl: "http://3.15.198.35:8080" # Example IP with port +``` + +#### 6. Persistent Volume for MySQL + +For persistent storage, especially for MySQL, define the storage size under the `mysql` section. This ensures that your database retains data across pod restarts and deployments. + +```yaml +mysql: + storage: "10Gi" +``` + +## Configure Web UI + +In folder `kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js` edit the `config.js.default` configuration file with your configuration. + + ``` +{ + TITLE: "Openslice demo", + WIKI: "{{ .Values.rooturl }}", + BUGZILLA: "{{ .Values.rooturl }}/bugzilla/", + STATUS: "{{ .Values.rooturl }}/", + APIURL: "{{ .Values.rooturl }}", + WEBURL: "{{ .Values.rooturl }}/nfvportal", + APIOAUTHURL: "{{ .Values.rooturl }}/auth/realms/openslice", + APITMFURL: "{{ .Values.rooturl }}/tmf-api/serviceCatalogManagement/v4" +} +``` + +Rename `config.js.default` to `config.js`. This is **mandatory** for the configuration file to be discoverable. + +## Configure TMF Web UI + +In the folder `kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config` there are 3 files available for configuration: + +* config.prod.json (Basic information + API configuration) +* theming.scss (CSS color palette theming) +* config.theming.json (HTML configuration - Logo, Favicon, Footer) + + +The first 2 files above (i.e. config.prod.json, theming.scss) are essential for the successful deployment of OpenSlice. +Therefore, ensure that you check the `config.prod.json` and `theming.scss` files and readjust to your deployment if needed. +Default versions of such files exist in this path, which must be renamed to not include the `.default` suffix, before deploying OpenSlice. + +E.g. Edit "TITLE", "WIKI", etc properties with your domain title. Also configure TMF's API and Keycloak's location for the web application, if needed. + +``` +{ + "TITLE": "OpenSlice by ETSI", + "PORTALVERSION":"2024-Q2 1.0.0-SNAPSHOT", + "WIKI": "https://osl.etsi.org/documentation", + "BUGZILLA": "{BASEURL}/bugzilla/", + "STATUS": "http://status.localhost/", + "WEBURL": "{BASEURL}", + "PORTAL_REPO_APIURL": "{BASEURL}/osapi", + "ASSURANCE_SERVICE_MGMT_APIURL": "{BASEURL}/oas-api", + "APITMFURL": "{BASEURL}/tmf-api", + "OAUTH_CONFIG" : { + "issuer": "{BASEURL}/auth/realms/openslice", + "loginUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/auth", + "tokenEndpoint": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/token", + "userinfoEndpoint": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/userinfo", + "redirectUri": "{BASEURL}/redirect", + "logoutUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/logout", + "postLogoutRedirectUri": "{BASEURL}", + + "responseType": "code", + "oidc": false, + "clientId": "osapiWebClientId", + "dummyClientSecret": "secret", + + "requireHttps": false, + "useHttpBasicAuth": true, + "clearHashAfterLogin": false, + + "showDebugInformation": true + } +} +``` + +> The {BASEURL} placeholder in the file automatically detects the Origin (Protocol://Domain:Port) of the deployment and applies it to every respective property. E.g. If you are attempting a local deployment of Openslice, then {BASEURL} is automatically translated to "http://localhost". Similarly, you may use {BASEURL} to translate to a public deployment configuration, e.g. "https://portal.openslice.io". + +If further customization, apart from the default provided, is needed for branding (Logo, Footer) then `config.theming.json` needs to be created in io.openslice.tmf.web/src/assets/config directory, as follows: + +```bash +# Starting from the root project directory +cd kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config +``` + +```bash +sudo cp config.theming.default.json config.theming.json +``` +#This seems irrelevant now. +> ***IMPORTANT NOTE:*** +If you want to apply changes to the JSON configuration files without the need to rebuild the application, you have to apply the changes at the `org.etsi.osl.tmf.web/dist/io-openslice-portal-web/assets/config` directory. Although, it is mandatory to also apply these changes to the `org.etsi.osl.tmf.web/src/assets/config` for persistancy, as after any future rebuild of OpenSlice the `/dist` directory is being overwritten along with its contents. The OpenSlice team strongly recommends to always apply your changes to the TMF web UI configuration files at `org.etsi.osl.tmf.web/src/assets/config` and rebuild the application. + +### 3. Deploy the Helm Chart + +After configuring the services, and editing the docker compose file accordingly, the docker compose instantiation command can be performed. + +```bash +cd kubernetes/helm/openslice/ +helm install myopenslice . --namespace openslice --create-namespace +``` + +## Validating deployments and container monitoring + +In a Kubernetes environment, you can monitor the status of your deployments and containers using `kubectl`, the Kubernetes command-line tool, which provides powerful capabilities for inspecting the state of resources in your cluster. + + +## Post installation steps + +After the successful deployment of OpenSlice, to ensure the E2E user experience, **this section is mandatory**. It contains crucial configuration in regard of authentication and user creation. + +### Checking the Status of your application's deployment + +To check the status of your deployment, use the following commands. The output should be similar: + +```bash + +kubectl get pods -n openslice -o wide + +NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES +activemq-59d4bfdb4b-bvjqr 1/1 Running 0 109s 192.168.43.97 kc-2 +bugzilla-client-7dd7cb47cb-8qb8m 1/1 Running 0 100s 192.168.12.114 kc-3 +centrallog-95bbf7867-k8fpt 1/1 Running 0 100s 192.168.12.107 kc-3 +consul-b5dd76b76-64dzk 1/1 Running 0 107s 192.168.43.90 kc-2 +keycloak-7c5b6bbc95-k2qfl 1/1 Running 0 105s 192.168.12.106 kc-3 +manoclient-95f68f4c9-c9t6r 1/1 Running 0 104s 192.168.12.113 kc-3 +mysql-portal-0 1/1 Running 0 107s 192.168.43.99 kc-2 +osom-6d548cf555-q8ptj 1/1 Running 0 104s 192.168.43.93 kc-2 +osportalapi-5fff744db8-5g4zs 1/1 Running 0 103s 192.168.43.98 kc-2 +osscapi-6d68b54d97-jn8tz 0/1 Running 0 102s 192.168.12.104 kc-3 +portalweb-8469d57df4-94tfj 1/1 Running 0 101s 192.168.48.44 kc-nfs +tmfweb-868f7bb9c5-x4lfh 1/1 Running 0 102s 192.168.48.43 kc-nfs +``` +```bash +kubectl get deployments -n openslice -o wide + +NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR +activemq 1/1 1 1 2m15s anactivemq webcenter/activemq:5.14.3 org.etsi.osl.service=activemq +bugzilla-client 1/1 1 1 2m6s bugzilla-client openslice/org.etsi.osl.bugzilla:latest org.etsi.osl.service=bugzilla-client +centrallog 1/1 1 1 2m6s centrallog openslice/org.etsi.osl.centrallog.service org.etsi.osl.service=centrallog +consul 1/1 1 1 2m13s aconsul consul org.etsi.osl.service=consul +keycloak 1/1 1 1 2m11s keycloak quay.io/keycloak/keycloak:11.0.3 org.etsi.osl.service=keycloak +manoclient 1/1 1 1 2m10s manoclient openslice/org.etsi.osl.mano:latest org.etsi.osl.service=manoclient +osom 1/1 1 1 2m10s openslice-osom openslice/org.etsi.osl.osom:latest org.etsi.osl.service=osom +osportalapi 1/1 1 1 2m9s openslice-portalapi openslice/org.etsi.osl.portal.api:latest org.etsi.osl.service=osportalapi +osscapi 1/1 1 1 2m8s openslice-scapi openslice/org.etsi.osl.tmf.api:latest org.etsi.osl.service=osscapi +portalweb 1/1 1 1 2m7s openslice-portalweb openslice/org.etsi.osl.portal.web:latest org.etsi.osl.service=portalweb +tmfweb 1/1 1 1 2m8s openslice-tmfweb openslice/org.etsi.osl.tmf.web:latest org.etsi.osl.service=tmfweb +``` +```bash +kubectl get services -n openslice -o wide + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR +activemq ClusterIP 10.111.160.120 8161/TCP,61616/TCP 2m22s org.etsi.osl.service=activemq +bugzilla-client ClusterIP 10.101.43.28 13010/TCP 2m14s org.etsi.osl.service=bugzilla-client +centrallog ClusterIP 10.109.15.151 13013/TCP 2m14s org.etsi.osl.service=centrallog +consul ClusterIP 10.101.103.240 8500/TCP,8600/TCP 2m21s org.etsi.osl.service=consul +keycloak ClusterIP 10.110.216.62 8080/TCP,8443/TCP 2m19s org.etsi.osl.service=keycloak +manoclient ClusterIP 10.108.112.84 13011/TCP 2m18s org.etsi.osl.service=manoclient +mysql-portal ClusterIP None 3306/TCP 2m19s org.etsi.osl.service=mysql-portal +osom ClusterIP 10.105.173.85 13100/TCP 2m18s org.etsi.osl.service=osom +osportalapi ClusterIP 10.104.121.164 13000/TCP 2m17s org.etsi.osl.service=osportalapi +osscapi ClusterIP 10.108.6.161 13082/TCP 2m16s org.etsi.osl.service=osscapi +portalweb ClusterIP 10.97.126.98 80/TCP 2m15s org.etsi.osl.service=portalweb +tmfweb ClusterIP 10.98.56.82 80/TCP 2m15s org.etsi.osl.service=tmfweb +``` + +### Accessing Logs for Troubleshooting + +If a pod is not in the expected state, you can access its logs for troubleshooting: + +```bash +kubectl logs -n openslice +``` + +### Configure Keycloak server + +The Keycloack server is managing authentication and running on a container at port 8080. It is also proxied to your host via the ingress resource under http:///auth. + +- Navigate to http:///auth/ or https:///auth/, (http://ipaddress:8080/auth/ or https://ipaddress:8443/auth/ which are directly accessible without proxy) + +- Navigate to Administration Console + +- Login with the credentials from section [Keycloak Configuration](#3-keycloak-configuration). Default values are: + - user: admin + - password: KEYCLOAK_PASSWORD + +> if you are running in HTTP you will get a message: HTTPS required. + +To resolve this issue when running in HTTP: + +- Select the master realm from top left corner +- Go to login Tab and select "Require SSL": None +- Repeat for realm Openslice + + +> If you are running in HTTPS, then "Require SSL" can be left unchanged to external requests. + +#### 1. Configure redirects + +Navigate to realm Openslice > client > osapiWebClientId and change the Root URL to your domain. + +Also, insert your domain, e.g. http://example.org/*, at: +* Valid Redirect URIs +* Web Origins + +#### 2. Configure email + +Keycloak allows new users to register. Subsequently, this will also allow new users to register to the OpenSlice portal. + +On Tab Login > check User registration, Verify email, Forgot password etc. + +Also, enter the details on Realm > Email > Enable Authentication. + +#### 3. Add an OpenSlice admin user + +This step is mandatory so as to access the OpenSlice Web UI. To add an OpenSlice admin user you must: +- Navigate to manage/users and add an OpenSlice admin user, e.g. username=admin. +- Set a password +- Navigate to Role Mappings and add ADMIN and MENTOR to Assigned Roles. + +> That user is different from the Keycloak admin user. It is required to login and browse the OpenSlice Web UI. The Roles ADMIN and MENTOR guarantee full access through the Openslice UI, thus such a user is always required. + +***IMPORTANT: The following is not currently supported in Kubernetes installation.** +### Keycloak at localhost + +> **This is an important step if you run Keycloak on localhost!** + +1 - Edit your Hosts File, adding the line below + +```127.0.0.1 keycloak``` + +Hosts File Location: + + - In Linux/Unix, the file's location is at /etc/hosts + + - In Windows, its location is at c:\Windows\System32\Drivers\etc\hosts + +2 - Replace http://localhost/auth/ with http://keycloak:8080/auth/ in your Keycloak config for AngularJS and Angular (see examples below). + + +> Explanation + +Nginx uses the http://keycloak:8080 URL, which is accessible via the internal docker system's network. +The Front-end (TS/Angular) shall also use the http://keycloak:8080. +This way, you will not get the invalid token error, as the API is acquiring the token from http://keycloak:8080 (internally) and the Front-end is getting verified by an issuer at the same URL, as well. + + + +2.1 - For the Angular configuration (TMF portal UI), navigate to org.etsi.osl.tmf.web/src/assets/config and edit config.prod.json + +```bash +# Starting from the root project directory +cd org.etsi.osl.tmf.web/src/assets/config +``` + +```bash +nano config.prod.json +``` + +After editing it should look like the example bellow: + +```yaml +{ + "TITLE": "OpenSlice by ETSI", + "PORTALVERSION":"2023-Q3 1.2.0-SNAPSHOT", + "WIKI": "https://openslice.readthedocs.io/en/stable/", + "BUGZILLA": "{BASEURL}/bugzilla/", + "STATUS": "http://status.localhost/", + "WEBURL": "{BASEURL}", + "PORTAL_REPO_APIURL": "{BASEURL}/osapi", + "ASSURANCE_SERVICE_MGMT_APIURL": "{BASEURL}/oas-api", + "APITMFURL": "{BASEURL}/tmf-api", + "OAUTH_CONFIG" : { + "issuer": "http://keycloak:8080/auth/realms/openslice", + "loginUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth", + "tokenEndpoint": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token", + "userinfoEndpoint": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/userinfo", + "redirectUri": "{BASEURL}/redirect", + "logoutUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/logout", + "postLogoutRedirectUri": "{BASEURL}", + + "responseType": "code", + "oidc": false, + "clientId": "osapiWebClientId", + "dummyClientSecret": "secret", + + "requireHttps": false, + "useHttpBasicAuth": true, + clearHashAfterLogin": false, + + "showDebugInformation": true + } +} +``` + +> Note the difference in changing {BASEURL} -> http://keycloak:8080 + +> If you want the changes to take place immediately without rebuilding the project, then repeat the process for org.etsi.osl.tmf.web/dist/org.etsi.osl.tmf.web/assets/config/config.prod.json + +2.2 - For the AngularJS configuration (NVF portal UI), navigate to org.etsi.osl.portal.web/src/js and edit config.js + +```bash +# Starting from the root project directory +cd org.etsi.osl.portal.web/src/js +``` + +```bash +nano config.js +``` + +after editing it should look like the example bellow: + +``` +var appConfig = angular.module('portalwebapp.config',[]); + + +appConfig.factory('APIEndPointService', function() { + return { + TITLE: "OpenSlice by ETSI", + WIKI: "https://openslice.readthedocs.io/en/stable/", + BUGZILLA: "ROOTURL/bugzilla/", + STATUS: "ROOTURL/status/", + APIURL: "http://localost:13000", + WEBURL: "ROOTURL/nfvportal", + APIOAUTHURL: "ROOTURL/auth/realms/openslice", + APITMFURL: "ROOTURL/tmf-api/serviceCatalogManagement/v4" + }; +}); +``` + +> Note the difference in "APIOAUTHURL" property + + +### NFV Orchestrator Configuration + +After successfully deploying and configuring OpenSlice, you may configure its environment (e.g. the NFVO) that will facilitate the deployment of NFV artifacts. + +See [NFV Orchestrator Configuration](./nfvoconfig.md). -- GitLab From 7f5a096080308e7a390439f22cc0057c72bf805c Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Fri, 12 Apr 2024 10:39:28 +0300 Subject: [PATCH 4/9] feat: added cridge to helm chart --- .../files/org.etsi.osl.cridge/kubeconfig.yaml | 19 ++++++ .../openslice/templates/cridge-config.yaml | 13 ++++ .../helm/openslice/templates/cridge.yaml | 61 +++++++++++++++++++ .../helm/openslice/templates/portalweb.yaml | 4 ++ kubernetes/helm/openslice/values.yaml | 8 +++ 5 files changed, 105 insertions(+) create mode 100644 kubernetes/helm/openslice/files/org.etsi.osl.cridge/kubeconfig.yaml create mode 100644 kubernetes/helm/openslice/templates/cridge-config.yaml create mode 100644 kubernetes/helm/openslice/templates/cridge.yaml diff --git a/kubernetes/helm/openslice/files/org.etsi.osl.cridge/kubeconfig.yaml b/kubernetes/helm/openslice/files/org.etsi.osl.cridge/kubeconfig.yaml new file mode 100644 index 0000000..1176403 --- /dev/null +++ b/kubernetes/helm/openslice/files/org.etsi.osl.cridge/kubeconfig.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Config +clusters: +- name: development-cluster + cluster: + certificate-authority: path/to/ca.crt # Path to certificate authority file + server: https://123.45.67.89:6443 # Cluster API server address +contexts: +- name: dev-user@development-cluster + context: + cluster: development-cluster + namespace: development # Default namespace + user: dev-user +current-context: dev-user@development-cluster +users: +- name: dev-user + user: + client-certificate: path/to/cert.crt # Path to the client certificate + client-key: path/to/key.key # Path to the client key diff --git a/kubernetes/helm/openslice/templates/cridge-config.yaml b/kubernetes/helm/openslice/templates/cridge-config.yaml new file mode 100644 index 0000000..d6611dc --- /dev/null +++ b/kubernetes/helm/openslice/templates/cridge-config.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: {{ .Release.Namespace }} + labels: + app: {{ include "openslice.fullname" . }} + org.etsi.osl.service: cridge + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + {{- include "openslice.labels" . | nindent 4 }} + name: {{ include "openslice.fullname" . }}-cridge-kubeconfig +data: + kubeconfig: |- + {{ .Files.Get "files/org.etsi.osl.cridge/kubeconfig.yaml" | indent 4 }} diff --git a/kubernetes/helm/openslice/templates/cridge.yaml b/kubernetes/helm/openslice/templates/cridge.yaml new file mode 100644 index 0000000..be3d86e --- /dev/null +++ b/kubernetes/helm/openslice/templates/cridge.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + namespace: {{ .Release.Namespace }} + labels: + app: {{ include "openslice.fullname" . }} + org.etsi.osl.service: cridge + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + {{- include "openslice.labels" . | nindent 4 }} + name: {{ include "openslice.fullname" . }}-cridge +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + serviceName: {{ include "openslice.fullname" . }}-cridge + selector: + matchLabels: + app: {{ include "openslice.fullname" . }} + org.etsi.osl.service: cridge + {{- include "openslice.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + app: {{ include "openslice.fullname" . }} + org.etsi.osl.service: cridge + {{- include "openslice.selectorLabels" . | nindent 8 }} + spec: + initContainers: + - name: init-osscapi + image: busybox:1.28 + command: ['sh', '-c', "until nslookup {{ include "openslice.fullname" . }}-osscapi; do echo waiting for osscapi; sleep 2; done"] + containers: + - image: "{{ .Values.image.cridge.repository }}:{{ .Values.image.cridge.tag | default .Chart.AppVersion }}" + name: {{ include "openslice.fullname" . }}-cridge + env: + - name: SPRING_APPLICATION_JSON + value: >- + { + "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", + "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", + "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}", + "org.etsi.osl.cridge" : "{{ .Values.cridge.mode | default 'DEBUG' }}" + } + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: cridge-kubeconfig + readOnly: true + mountPath: /root/.kube + readinessProbe: + exec: + command: ["sh", "-c", "kubectl version --client"] + initialDelaySeconds: 5 + periodSeconds: 2 + timeoutSeconds: 1 + restartPolicy: Always + volumes: + - name: cridge-kubeconfig + configMap: + name: {{ include "openslice.fullname" . }}-cridge-kubeconfig diff --git a/kubernetes/helm/openslice/templates/portalweb.yaml b/kubernetes/helm/openslice/templates/portalweb.yaml index 62b5d90..9beec9d 100644 --- a/kubernetes/helm/openslice/templates/portalweb.yaml +++ b/kubernetes/helm/openslice/templates/portalweb.yaml @@ -36,6 +36,10 @@ spec: - name: portalweb-configuration mountPath: /usr/share/nginx/html/nfvportal/js/config.js subPath: config.js + readinessProbe: + httpGet: + path: /tmf-api/serviceCatalogManagement/v4 + port: 80 volumes: - name: portalweb-configuration configMap: diff --git a/kubernetes/helm/openslice/values.yaml b/kubernetes/helm/openslice/values.yaml index 764d658..256322e 100644 --- a/kubernetes/helm/openslice/values.yaml +++ b/kubernetes/helm/openslice/values.yaml @@ -75,6 +75,11 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "develop" + cridge: + repository: labs.etsi.org:5050/osl/code/org.etsi.osl.cridge + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "develop" bugzillaurl: example.com:443/bugzilla bugzillakey: VH2Vw0iI5aYgALFFzVDWqhACwt6Hu3bXla9kSC1Z @@ -107,6 +112,9 @@ spring: mysql: storage: 10Gi +cridge: + mode: "DEBUG" + # Storage class to be used for provisioning. Default is manual # storageClass: ~ -- GitLab From 7b645cb4c141727a751fa6fd3c04d11a6021c734 Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Mon, 15 Apr 2024 17:09:31 +0300 Subject: [PATCH 5/9] fix: sytax error --- kubernetes/helm/openslice/templates/cridge.yaml | 4 ++-- kubernetes/helm/openslice/templates/manoclient.yaml | 2 +- kubernetes/helm/openslice/templates/oasapi.yaml | 2 +- kubernetes/helm/openslice/templates/osom.yaml | 2 +- kubernetes/helm/openslice/templates/osportalapi.yaml | 2 +- kubernetes/helm/openslice/templates/osscapi.yaml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kubernetes/helm/openslice/templates/cridge.yaml b/kubernetes/helm/openslice/templates/cridge.yaml index be3d86e..7c80c48 100644 --- a/kubernetes/helm/openslice/templates/cridge.yaml +++ b/kubernetes/helm/openslice/templates/cridge.yaml @@ -39,8 +39,8 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}", - "org.etsi.osl.cridge" : "{{ .Values.cridge.mode | default 'DEBUG' }}" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}", + "org.etsi.osl.cridge" : "{{ .Values.cridge.mode | default "DEBUG" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/manoclient.yaml b/kubernetes/helm/openslice/templates/manoclient.yaml index e3f1664..caea660 100644 --- a/kubernetes/helm/openslice/templates/manoclient.yaml +++ b/kubernetes/helm/openslice/templates/manoclient.yaml @@ -34,7 +34,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/oasapi.yaml b/kubernetes/helm/openslice/templates/oasapi.yaml index c995d89..1b4ec2c 100644 --- a/kubernetes/helm/openslice/templates/oasapi.yaml +++ b/kubernetes/helm/openslice/templates/oasapi.yaml @@ -54,7 +54,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/osom.yaml b/kubernetes/helm/openslice/templates/osom.yaml index 30006af..906bed0 100644 --- a/kubernetes/helm/openslice/templates/osom.yaml +++ b/kubernetes/helm/openslice/templates/osom.yaml @@ -34,7 +34,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/osportalapi.yaml b/kubernetes/helm/openslice/templates/osportalapi.yaml index 5d78d73..072c2f5 100644 --- a/kubernetes/helm/openslice/templates/osportalapi.yaml +++ b/kubernetes/helm/openslice/templates/osportalapi.yaml @@ -55,7 +55,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default 'INFO' }}" + "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/osscapi.yaml b/kubernetes/helm/openslice/templates/osscapi.yaml index b0f8f0f..6721ca2 100644 --- a/kubernetes/helm/openslice/templates/osscapi.yaml +++ b/kubernetes/helm/openslice/templates/osscapi.yaml @@ -55,7 +55,7 @@ spec: "spring.activemq.brokerUrl": "tcp://{{ include "openslice.fullname" . }}-artemis:61616?jms.watchTopicAdvisories=false", "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", - "logging.level.org.springframework": "{{ .Values.spring.logLevel | default 'INFO' }}", + "logging.level.org.springframework": "{{ .Values.spring.logLevel | default "INFO" }}", "kroki.serverurl":"{{ .Values.rooturl }}/kroki" } resources: -- GitLab From 3553d8517ffeb739efc3df3214500e2451ea078e Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Thu, 18 Apr 2024 19:46:34 +0300 Subject: [PATCH 6/9] fix: helm syntax fix --- kubernetes/helm/openslice/templates/cridge-config.yaml | 2 +- kubernetes/helm/openslice/templates/mysql-config.yaml | 4 ++-- kubernetes/helm/openslice/templates/openslice-ingress.yaml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kubernetes/helm/openslice/templates/cridge-config.yaml b/kubernetes/helm/openslice/templates/cridge-config.yaml index d6611dc..a70e104 100644 --- a/kubernetes/helm/openslice/templates/cridge-config.yaml +++ b/kubernetes/helm/openslice/templates/cridge-config.yaml @@ -10,4 +10,4 @@ metadata: name: {{ include "openslice.fullname" . }}-cridge-kubeconfig data: kubeconfig: |- - {{ .Files.Get "files/org.etsi.osl.cridge/kubeconfig.yaml" | indent 4 }} + {{- .Files.Get "files/org.etsi.osl.cridge/kubeconfig.yaml" | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/mysql-config.yaml b/kubernetes/helm/openslice/templates/mysql-config.yaml index ae35d5f..0de0e52 100644 --- a/kubernetes/helm/openslice/templates/mysql-config.yaml +++ b/kubernetes/helm/openslice/templates/mysql-config.yaml @@ -9,5 +9,5 @@ metadata: {{- include "openslice.labels" . | nindent 4 }} name: {{ include "openslice.fullname" . }}-mysql-initdb-config data: - 01-databases.sql: |- - {{ .Files.Get "files/mysql-init/01-databases.sql" | indent 4 }} + 01-databases.sql: | + {{- tpl (.Files.Get "files/mysql-init/01-databases.sql") . | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/openslice-ingress.yaml b/kubernetes/helm/openslice/templates/openslice-ingress.yaml index 7c5523e..a2c4b57 100644 --- a/kubernetes/helm/openslice/templates/openslice-ingress.yaml +++ b/kubernetes/helm/openslice/templates/openslice-ingress.yaml @@ -14,12 +14,13 @@ spec: rules: - http: paths: + {{- $root := . }} # Preserve the root context {{- range .Values.ingress.paths }} - pathType: Prefix path: "{{ .path }}" backend: service: - name: {{ include "openslice.fullname" . }}-{{ .service }} + name: {{ include "openslice.fullname" $root }}-{{ .service }} port: number: {{ .port }} {{- end }} -- GitLab From c9f0ab2aa8815e3006eb8ed38c742ec338b18f18 Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Thu, 18 Apr 2024 19:54:03 +0300 Subject: [PATCH 7/9] fix: corrected keycloak image based --- kubernetes/helm/openslice/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/openslice/values.yaml b/kubernetes/helm/openslice/values.yaml index 256322e..cbc1df7 100644 --- a/kubernetes/helm/openslice/values.yaml +++ b/kubernetes/helm/openslice/values.yaml @@ -26,7 +26,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "develop" keycloak: - repository: jboss/keycloak + repository: quay.io/keycloak/keycloak pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "16.1.1" -- GitLab From 858122e7f47e73584cd0e4a46b5095026faf416c Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Thu, 25 Apr 2024 16:36:10 +0300 Subject: [PATCH 8/9] feat: cleanup of files and properties --- .../helm/openslice/templates/artemis.yaml | 1 + .../helm/openslice/templates/blockdiag.yaml | 1 + .../helm/openslice/templates/bugzilla.yaml | 1 + .../helm/openslice/templates/centrallog.yaml | 1 + .../openslice/templates/cridge-config.yaml | 2 +- .../helm/openslice/templates/cridge.yaml | 12 ++------ .../helm/openslice/templates/keycloak.yaml | 1 + .../helm/openslice/templates/kroki.yaml | 1 + .../helm/openslice/templates/manoclient.yaml | 1 + .../helm/openslice/templates/mysql.yaml | 1 + .../helm/openslice/templates/oasapi.yaml | 1 + kubernetes/helm/openslice/templates/osom.yaml | 1 + .../helm/openslice/templates/osportalapi.yaml | 1 + .../helm/openslice/templates/osscapi.yaml | 1 + .../helm/openslice/templates/portalweb.yaml | 1 + .../helm/openslice/templates/tmfweb.yaml | 1 + kubernetes/helm/openslice/values.yaml | 30 +++++++++---------- 17 files changed, 33 insertions(+), 25 deletions(-) diff --git a/kubernetes/helm/openslice/templates/artemis.yaml b/kubernetes/helm/openslice/templates/artemis.yaml index 74c4800..87c75ea 100644 --- a/kubernetes/helm/openslice/templates/artemis.yaml +++ b/kubernetes/helm/openslice/templates/artemis.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.artemis.repository }}:{{ .Values.image.artemis.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.artemis.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-artemis resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/blockdiag.yaml b/kubernetes/helm/openslice/templates/blockdiag.yaml index fbd5e7a..30b2025 100644 --- a/kubernetes/helm/openslice/templates/blockdiag.yaml +++ b/kubernetes/helm/openslice/templates/blockdiag.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.blockdiag.repository }}:{{ .Values.image.blockdiag.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.blockdiag.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-blockdiag resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/bugzilla.yaml b/kubernetes/helm/openslice/templates/bugzilla.yaml index 6402257..d759a25 100644 --- a/kubernetes/helm/openslice/templates/bugzilla.yaml +++ b/kubernetes/helm/openslice/templates/bugzilla.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.bugzilla.repository }}:{{ .Values.image.bugzilla.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.bugzilla.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-bugzilla env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/centrallog.yaml b/kubernetes/helm/openslice/templates/centrallog.yaml index a43e810..b8143fc 100644 --- a/kubernetes/helm/openslice/templates/centrallog.yaml +++ b/kubernetes/helm/openslice/templates/centrallog.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.centrallog.repository }}:{{ .Values.image.centrallog.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.centrallog.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-centrallog env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/cridge-config.yaml b/kubernetes/helm/openslice/templates/cridge-config.yaml index a70e104..a08ebd4 100644 --- a/kubernetes/helm/openslice/templates/cridge-config.yaml +++ b/kubernetes/helm/openslice/templates/cridge-config.yaml @@ -9,5 +9,5 @@ metadata: {{- include "openslice.labels" . | nindent 4 }} name: {{ include "openslice.fullname" . }}-cridge-kubeconfig data: - kubeconfig: |- + config: |- {{- .Files.Get "files/org.etsi.osl.cridge/kubeconfig.yaml" | nindent 4 }} diff --git a/kubernetes/helm/openslice/templates/cridge.yaml b/kubernetes/helm/openslice/templates/cridge.yaml index 7c80c48..3b90404 100644 --- a/kubernetes/helm/openslice/templates/cridge.yaml +++ b/kubernetes/helm/openslice/templates/cridge.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: namespace: {{ .Release.Namespace }} labels: @@ -12,7 +12,6 @@ spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} - serviceName: {{ include "openslice.fullname" . }}-cridge selector: matchLabels: app: {{ include "openslice.fullname" . }} @@ -31,6 +30,7 @@ spec: command: ['sh', '-c', "until nslookup {{ include "openslice.fullname" . }}-osscapi; do echo waiting for osscapi; sleep 2; done"] containers: - image: "{{ .Values.image.cridge.repository }}:{{ .Values.image.cridge.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.cridge.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-cridge env: - name: SPRING_APPLICATION_JSON @@ -40,7 +40,7 @@ spec: "spring.activemq.user": "{{ .Values.oscreds.activemq.user }}", "spring.activemq.password": "{{ .Values.oscreds.activemq.password }}", "logging.level.org.springframework" : "{{ .Values.spring.logLevel | default "INFO" }}", - "org.etsi.osl.cridge" : "{{ .Values.cridge.mode | default "DEBUG" }}" + "org.etsi.osl.cridge" : "{{ .Values.cridge.mode | default "DEBUG" }}" } resources: {{- toYaml .Values.resources | nindent 12 }} @@ -48,12 +48,6 @@ spec: - name: cridge-kubeconfig readOnly: true mountPath: /root/.kube - readinessProbe: - exec: - command: ["sh", "-c", "kubectl version --client"] - initialDelaySeconds: 5 - periodSeconds: 2 - timeoutSeconds: 1 restartPolicy: Always volumes: - name: cridge-kubeconfig diff --git a/kubernetes/helm/openslice/templates/keycloak.yaml b/kubernetes/helm/openslice/templates/keycloak.yaml index 1b69756..fca2bdb 100644 --- a/kubernetes/helm/openslice/templates/keycloak.yaml +++ b/kubernetes/helm/openslice/templates/keycloak.yaml @@ -31,6 +31,7 @@ spec: hostNetwork: {{ .Values.hostNetwork }} containers: - image: "{{ .Values.image.keycloak.repository }}:{{ .Values.image.keycloak.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.keycloak.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-keycloak env: - name: DB_VENDOR diff --git a/kubernetes/helm/openslice/templates/kroki.yaml b/kubernetes/helm/openslice/templates/kroki.yaml index c6b6f71..3139d11 100644 --- a/kubernetes/helm/openslice/templates/kroki.yaml +++ b/kubernetes/helm/openslice/templates/kroki.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.kroki.repository }}:{{ .Values.image.kroki.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.kroki.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-kroki resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/manoclient.yaml b/kubernetes/helm/openslice/templates/manoclient.yaml index caea660..88fd713 100644 --- a/kubernetes/helm/openslice/templates/manoclient.yaml +++ b/kubernetes/helm/openslice/templates/manoclient.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.manoclient.repository }}:{{ .Values.image.manoclient.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.manoclient.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-manoclient env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/mysql.yaml b/kubernetes/helm/openslice/templates/mysql.yaml index 6aa246a..b69a3f1 100644 --- a/kubernetes/helm/openslice/templates/mysql.yaml +++ b/kubernetes/helm/openslice/templates/mysql.yaml @@ -27,6 +27,7 @@ spec: spec: containers: - image: "{{ .Values.image.mysql.repository }}:{{ .Values.image.mysql.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.mysql.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-mysql args: - "--ignore-db-dir=lost+found" diff --git a/kubernetes/helm/openslice/templates/oasapi.yaml b/kubernetes/helm/openslice/templates/oasapi.yaml index 1b4ec2c..c73b3df 100644 --- a/kubernetes/helm/openslice/templates/oasapi.yaml +++ b/kubernetes/helm/openslice/templates/oasapi.yaml @@ -34,6 +34,7 @@ spec: hostNetwork: {{ .Values.hostNetwork }} containers: - image: "{{ .Values.image.oasapi.repository }}:{{ .Values.image.oasapi.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.oasapi.pullPolicy | default "Always" }} name: {{ .Release.Name }}-oasapi env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/osom.yaml b/kubernetes/helm/openslice/templates/osom.yaml index 906bed0..12edc14 100644 --- a/kubernetes/helm/openslice/templates/osom.yaml +++ b/kubernetes/helm/openslice/templates/osom.yaml @@ -26,6 +26,7 @@ spec: spec: containers: - image: "{{ .Values.image.osom.repository }}:{{ .Values.image.osom.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.osom.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-osom env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/osportalapi.yaml b/kubernetes/helm/openslice/templates/osportalapi.yaml index 072c2f5..c84ee91 100644 --- a/kubernetes/helm/openslice/templates/osportalapi.yaml +++ b/kubernetes/helm/openslice/templates/osportalapi.yaml @@ -35,6 +35,7 @@ spec: command: ['sh', '-c', "until nslookup {{ include "openslice.fullname" . }}-mysql; do echo waiting for mysql; sleep 2; done"] containers: - image: "{{ .Values.image.portalapi.repository }}:{{ .Values.image.portalapi.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.portalapi.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-osportalapi env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/osscapi.yaml b/kubernetes/helm/openslice/templates/osscapi.yaml index 6721ca2..e52a6b3 100644 --- a/kubernetes/helm/openslice/templates/osscapi.yaml +++ b/kubernetes/helm/openslice/templates/osscapi.yaml @@ -34,6 +34,7 @@ spec: command: ['sh', '-c', "until nslookup {{ include "openslice.fullname" . }}-mysql; do echo waiting for mysql; sleep 2; done"] containers: - image: "{{ .Values.image.osscapi.repository }}:{{ .Values.image.osscapi.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.osscapi.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-osscapi env: - name: SPRING_APPLICATION_JSON diff --git a/kubernetes/helm/openslice/templates/portalweb.yaml b/kubernetes/helm/openslice/templates/portalweb.yaml index 9beec9d..c2b22a1 100644 --- a/kubernetes/helm/openslice/templates/portalweb.yaml +++ b/kubernetes/helm/openslice/templates/portalweb.yaml @@ -27,6 +27,7 @@ spec: hostNetwork: {{ .Values.hostNetwork }} containers: - image: "{{ .Values.image.portalweb.repository }}:{{ .Values.image.portalweb.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.portalweb.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-portalweb resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/templates/tmfweb.yaml b/kubernetes/helm/openslice/templates/tmfweb.yaml index 5ee8974..2d324ec 100644 --- a/kubernetes/helm/openslice/templates/tmfweb.yaml +++ b/kubernetes/helm/openslice/templates/tmfweb.yaml @@ -27,6 +27,7 @@ spec: hostNetwork: {{ .Values.hostNetwork }} containers: - image: "{{ .Values.image.tmfweb.repository }}:{{ .Values.image.tmfweb.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.tmfweb.pullPolicy | default "Always" }} name: {{ include "openslice.fullname" . }}-tmfweb resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/kubernetes/helm/openslice/values.yaml b/kubernetes/helm/openslice/values.yaml index cbc1df7..2f6ccca 100644 --- a/kubernetes/helm/openslice/values.yaml +++ b/kubernetes/helm/openslice/values.yaml @@ -7,77 +7,77 @@ replicaCount: 1 image: artemis: repository: apache/activemq-artemis - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "2.30.0" blockdiag: repository: yuzutech/kroki-blockdiag - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "latest" bugzilla: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.bugzilla - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" centrallog: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.centrallog.service - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" keycloak: repository: quay.io/keycloak/keycloak - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "16.1.1" kroki: repository: yuzutech/kroki - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "latest" manoclient: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.mano - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" osom: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.osom - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" portalapi: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.portal.api - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" osscapi: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.tmf.api - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" mysql: repository: mysql - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "5.7.43" oasapi: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.oas - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" portalweb: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.portal.web - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" tmfweb: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.tmf.web - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" cridge: repository: labs.etsi.org:5050/osl/code/org.etsi.osl.cridge - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "develop" -- GitLab From a6afd64daf94db5f0bb26996572fe3b299bf18bc Mon Sep 17 00:00:00 2001 From: dgiannopoulos Date: Mon, 29 Apr 2024 11:52:11 +0300 Subject: [PATCH 9/9] fix: template cm before applying --- kubernetes/helm/openslice/templates/portalweb-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kubernetes/helm/openslice/templates/portalweb-config.yaml b/kubernetes/helm/openslice/templates/portalweb-config.yaml index 10e8ade..35e9c50 100644 --- a/kubernetes/helm/openslice/templates/portalweb-config.yaml +++ b/kubernetes/helm/openslice/templates/portalweb-config.yaml @@ -10,4 +10,5 @@ metadata: {{- include "openslice.labels" . | nindent 4 }} data: config.js: | - {{- .Files.Get "files/org.etsi.osl.portal.web/src/js/config.js" | nindent 4 }} + {{- tpl (.Files.Get "files/org.etsi.osl.portal.web/src/js/config.js") . | nindent 4 }} + \ No newline at end of file -- GitLab