diff options
24 files changed, 519 insertions, 458 deletions
diff --git a/kubernetes/aai/resources/sparky-be/conf/logback.xml b/kubernetes/aai/resources/sparky-be/conf/logback.xml index b822662050..c1b99c183f 100644 --- a/kubernetes/aai/resources/sparky-be/conf/logback.xml +++ b/kubernetes/aai/resources/sparky-be/conf/logback.xml @@ -15,7 +15,7 @@ <property name="maxFileSize" value="50MB" /> <property name="maxHistory" value="30" /> <property name="totalSizeCap" value="10GB" /> - <property name="pattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}\t[%thread]\t%-5level\t%logger{36}\t%replace(%replace(%replace(%mdc){'\t','\\\\t'}){', ','\t'}){'\n', '\\\\n'}\t%replace(%replace(%msg){'\n', '\\\\n'}){'\t','\\\\t'}%n" /> + <property name="pattern" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}\t[%thread]\t%-5level\t%logger{36}\t%replace(%replace(%replace(%mdc){'\t','\\\\t'}){', ','\t'}){'\n', '\\\\n'}\t%replace(%replace(%msg){'\n', '\\\\n'}){'\t','\\\\t'}%n" /> <!-- Example evaluator filter applied against console appender --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> diff --git a/kubernetes/aai/templates/aai-resources-deployment.yaml b/kubernetes/aai/templates/aai-resources-deployment.yaml index 2e46284076..7ff5e66ee2 100644 --- a/kubernetes/aai/templates/aai-resources-deployment.yaml +++ b/kubernetes/aai/templates/aai-resources-deployment.yaml @@ -83,7 +83,7 @@ spec: path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-data/" - name: filebeat-conf hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/log4j/filebeat.yml + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml - name: aai-resources-logs emptyDir: {} - name: aai-resources-filebeat diff --git a/kubernetes/aai/templates/aai-traversal-deployment.yaml b/kubernetes/aai/templates/aai-traversal-deployment.yaml index 03bd0dcd87..f659392935 100644 --- a/kubernetes/aai/templates/aai-traversal-deployment.yaml +++ b/kubernetes/aai/templates/aai-traversal-deployment.yaml @@ -85,7 +85,7 @@ spec: path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-data/" - name: filebeat-conf hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/log4j/filebeat.yml + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml - name: aai-traversal-logs emptyDir: {} - name: aai-traversal-filebeat diff --git a/kubernetes/aai/templates/all-services.yaml b/kubernetes/aai/templates/all-services.yaml index df7e3567d0..5d1c09e111 100644 --- a/kubernetes/aai/templates/all-services.yaml +++ b/kubernetes/aai/templates/all-services.yaml @@ -43,8 +43,8 @@ metadata: "url": "/aai/v11/cloud-infrastructure", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-cloudInfrastructure-deprecated", @@ -52,9 +52,9 @@ metadata: "url": "/aai/v11/cloud-infrastructure", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/cloud-infrastructure" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/cloud-infrastructure" }, { "serviceName": "aai-business", @@ -62,8 +62,8 @@ metadata: "url": "/aai/v11/business", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-business-deprecated", @@ -71,9 +71,9 @@ metadata: "url": "/aai/v11/business", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/business" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/business" }, { "serviceName": "aai-search", @@ -81,8 +81,8 @@ metadata: "url": "/aai/v11/search", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-search-deprecated", @@ -90,9 +90,9 @@ metadata: "url": "/aai/v11/search", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/search" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/search" }, { "serviceName": "aai-actions", @@ -100,8 +100,8 @@ metadata: "url": "/aai/v11/actions", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-actions-deprecated", @@ -109,9 +109,9 @@ metadata: "url": "/aai/v11/actions", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/actions" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/actions" }, { "serviceName": "aai-service-design-and-creation", @@ -119,8 +119,8 @@ metadata: "url": "/aai/v11/service-design-and-creation", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-service-design-and-creation-deprecated", @@ -128,9 +128,9 @@ metadata: "url": "/aai/v11/service-design-and-creation", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/service-design-and-creation" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/service-design-and-creation" }, { "serviceName": "aai-network", @@ -138,8 +138,8 @@ metadata: "url": "/aai/v11/network", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1" + "enable_ssl": true, + "visualRange": "1" }, { "serviceName": "aai-network-deprecated", @@ -147,9 +147,9 @@ metadata: "url": "/aai/v11/network", "protocol": "REST", "port": "8443", - "enable_ssl":"True", - "visualRange":"1", - "path":"/aai/v11/network" + "enable_ssl": true, + "visualRange": "1", + "path": "/aai/v11/network" } ]' spec: diff --git a/kubernetes/aai/templates/search-data-service-deployment.yaml b/kubernetes/aai/templates/search-data-service-deployment.yaml index 60fdbb50cd..e1668456ba 100644 --- a/kubernetes/aai/templates/search-data-service-deployment.yaml +++ b/kubernetes/aai/templates/search-data-service-deployment.yaml @@ -62,7 +62,7 @@ spec: path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/search-data-service/appconfig/" - name: filebeat-conf hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/log4j/filebeat.yml + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml - name: aai-search-data-service-logs emptyDir: {} - name: aai-search-data-service-filebeat @@ -81,4 +81,4 @@ metadata: namespace: {{ .Values.nsPrefix }}-aai data: {{ (.Files.Glob "resources/search-data-service/conf/logback.xml").AsConfig | indent 2 }} -#{{ end }}
\ No newline at end of file +#{{ end }} diff --git a/kubernetes/aai/templates/sparky-be-deployment.yaml b/kubernetes/aai/templates/sparky-be-deployment.yaml index c60725ee15..484a87f5be 100644 --- a/kubernetes/aai/templates/sparky-be-deployment.yaml +++ b/kubernetes/aai/templates/sparky-be-deployment.yaml @@ -62,7 +62,7 @@ spec: path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/sparky-be/appconfig/" - name: filebeat-conf hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/log4j/filebeat.yml + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml - name: aai-sparky-be-logs emptyDir: {} - name: aai-sparky-filebeat @@ -81,4 +81,4 @@ metadata: namespace: {{ .Values.nsPrefix }}-aai data: {{ (.Files.Glob "resources/sparky-be/conf/logback.xml").AsConfig | indent 2 }} -#{{ end }}
\ No newline at end of file +#{{ end }} diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-dbbuilder.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-dbbuilder.json new file mode 100644 index 0000000000..ec5539060f --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-dbbuilder.json @@ -0,0 +1,22 @@ +{ + "service": { + "name": "Health Check: APPC - Dgbuilder", + "checks": [ + { + "id": "appc-dgbuilder", + "name": "APPC-Dgbuilder Server Health Check", + "http": "http://dgbuilder.onap-appc:3000/", + "method": "HEAD", + "header": { + "Authorization": ["Basic ZGd1c2VyOnRlc3QxMjM="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-health.json new file mode 100644 index 0000000000..9d09a59982 --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/appc-health.json @@ -0,0 +1,14 @@ +{ + "service": { + "name": "Health Check: APPC", + "checks": [ + { + "id": "appc-dbhost-healthcheck", + "name": "APPC DBHost Health Check", + "script": "/consul/config/scripts/appc-dbhost-script.sh", + "interval": "10s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/appc-dbhost-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/appc-dbhost-script.sh new file mode 100755 index 0000000000..4a78c315ba --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/appc-dbhost-script.sh @@ -0,0 +1,13 @@ +APPC_DBHOST_POD=$(/consul/config/bin/kubectl -n onap-appc get pod | grep -o "appc-dbhost-[^[:space:]]*") +if [ -n "$APPC_DBHOST_POD" ]; then + if /consul/config/bin/kubectl -n onap-appc exec -it $APPC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then + echo Success. APPC DBHost is running. 2>&1 + exit 0 + else + echo Failed. APPC DBHost is not running. 2>&1 + exit 1 + fi +else + echo Failed. APPC DBHost is offline. 2>&1 + exit 1 +fi diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh new file mode 100644 index 0000000000..c87686f764 --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh @@ -0,0 +1,14 @@ +NAME=$(/consul/config/bin/kubectl -n onap-vid get pod | grep -o "vid-mariadb[^[:space:]]*") + + if [ -n "$NAME" ]; then + if /consul/config/bin/kubectl -n onap-vid exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then + echo Success. mariadb process is running. 2>&1 + exit 0 + else + echo Failed. mariadb process is not running. 2>&1 + exit 1 + fi + else + echo Failed. mariadb container is offline. 2>&1 + exit 1 + fi diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/sdnc-dgbuilder.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/sdnc-dgbuilder.json new file mode 100644 index 0000000000..051c4abb3a --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/sdnc-dgbuilder.json @@ -0,0 +1,22 @@ +{ + "service": { + "name": "Health Check: SDNC - DGBuilder", + "checks": [ + { + "id": "sdnc-dgbuilder", + "name": "SDNC-DGbuilder Health Check", + "http": "http://sdnc-dgbuilder.onap-sdnc:3000/", + "method": "HEAD", + "header": { + "Authorization": ["Basic ZGd1c2VyOnRlc3QxMjM="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json new file mode 100644 index 0000000000..8a2a4dca9b --- /dev/null +++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json @@ -0,0 +1,29 @@ +{ + "service": { + "name": "Health Check: VID", + "checks": [ + { + "id": "vid-server", + "name": "VID Server Health Check", + "http": "http://vid-server.onap-vid:8080/vid/healthCheck", + "method": "GET", + "header": { + "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], + "Cache-Control": ["no-cache"], + "Content-Type": ["application/json"], + "Accept": ["application/json"] + }, + "tls_skip_verify": true, + "interval": "15s", + "timeout": "1s" + }, + { + "id": "vid-mariadb", + "name": "Vid Mariadb Health Check", + "script": "/consul/config/scripts/vid-mariadb-script.sh", + "interval": "10s", + "timeout": "1s" + } + ] + } +} diff --git a/kubernetes/config/docker/init/src/config/log/portal/portal-db/logback.xml b/kubernetes/config/docker/init/src/config/log/portal/portal-db/logback.xml deleted file mode 100644 index 4990fac239..0000000000 --- a/kubernetes/config/docker/init/src/config/log/portal/portal-db/logback.xml +++ /dev/null @@ -1,306 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<configuration debug="true" scan="true" scanPeriod="3 seconds">
- <!--
- Logback files for the ECOMP SDK Application "ecomp_app"
- are created in directory ${catalina.base}/logs/ecomp_app;
- e.g., apache-tomcat-8.0.35/logs/ecomp_app/application.log
- -->
- <!--<jmxConfigurator /> -->
- <!-- specify the component name -->
- <property name="componentName" value="portal"></property>
- <property name="subComponentName" value="portalDB"></property>
- <!-- specify the base path of the log directory -->
- <property name="logDirPrefix" value="/var/log/onap"></property>
- <!-- The directories where logs are written -->
- <property name="logDirectory" value="${logDirPrefix}/${componentName}/${subComponentName}" />
- <!-- Can easily relocate debug logs by modifying this path. -->
- <property name="debugLogDirectory" value="${logDirPrefix}/${componentName}/${subComponentName}" />
- <!-- log file names -->
- <property name="generalLogName" value="application" />
- <property name="errorLogName" value="error" />
- <property name="metricsLogName" value="metrics" />
- <property name="auditLogName" value="audit" />
- <property name="debugLogName" value="debug" />
- <!--
- These loggers are not used in code (yet).
- <property name="securityLogName" value="security" />
- <property name="policyLogName" value="policy" />
- <property name="performanceLogName" value="performance" />
- <property name="serverLogName" value="server" />
- -->
- <property name="pattern" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}\t[%thread]\t%-5level\t%logger{36}\t%replace(%replace(%replace(%mdc){'\t','\\\\t'}){', ','\t'}){'\n', '\\\\n'}\t%replace(%replace(%msg){'\n', '\\\\n'}){'\t','\\\\t'}%n" />
- <property name="maxHistory" value="30" />
- <property name="queueSize" value="256" />
- <property name="maxFileSize" value="50MB" />
- <property name="totalSizeCap" value="10GB" />
- <!-- Example evaluator filter applied against console appender -->
- <appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT">
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- </appender>
- <!-- ============================================================================ -->
- <!-- EELF Appenders -->
- <!-- ============================================================================ -->
- <!-- The EELFAppender is used to record events to the general application
- log -->
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELF">
- <file>${logDirectory}/${generalLogName}.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover -->
- <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
- <!-- keep 30 days' worth of history capped at ${totalSizeCap} total size -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>${maxFileSize}</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- <filter class="org.openecomp.fusionapp.util.CustomLoggingFilter" />
- </appender>
- <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELF">
- <queueSize>${queueSize}</queueSize>
- <!-- Class name is part of caller data -->
- <includeCallerData>true</includeCallerData>
- <appender-ref ref="EELF" />
- </appender>
- <!-- EELF Security Appender. This appender is used to record security events
- to the security log file. Security events are separate from other loggers
- in EELF so that security log records can be captured and managed in a secure
- way separate from the other logs. This appender is set to never discard any
- events. -->
- <!--
- <appender name="EELFSecurity"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${securityLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${logDirectory}/${securityLogName}.%i.log.zip
- </fileNamePattern>
- <minIndex>1</minIndex>
- <maxIndex>9</maxIndex>
- </rollingPolicy>
- <triggeringPolicy
- class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>5MB</maxFileSize>
- </triggeringPolicy>
- <encoder>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncEELFSecurity" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <discardingThreshold>0</discardingThreshold>
- <appender-ref ref="EELFSecurity" />
- </appender>
- -->
- <!-- EELF Performance Appender. This appender is used to record performance
- records. -->
- <!--
- <appender name="EELFPerformance"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${performanceLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${logDirectory}/${performanceLogName}.%i.log.zip
- </fileNamePattern>
- <minIndex>1</minIndex>
- <maxIndex>9</maxIndex>
- </rollingPolicy>
- <triggeringPolicy
- class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>5MB</maxFileSize>
- </triggeringPolicy>
- <encoder>
- <outputPatternAsHeader>true</outputPatternAsHeader>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- </appender>
- <appender name="asyncEELFPerformance" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="EELFPerformance" />
- </appender>
- -->
- <!-- EELF Server Appender. This appender is used to record Server related
- logging events. The Server logger and appender are specializations of the
- EELF application root logger and appender. This can be used to segregate Server
- events from other components, or it can be eliminated to record these events
- as part of the application root log. -->
- <!--
- <appender name="EELFServer"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${serverLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${logDirectory}/${serverLogName}.%i.log.zip
- </fileNamePattern>
- <minIndex>1</minIndex>
- <maxIndex>9</maxIndex>
- </rollingPolicy>
- <triggeringPolicy
- class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>5MB</maxFileSize>
- </triggeringPolicy>
- <encoder>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- </appender>
- <appender name="asyncEELFServer" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="EELFServer" />
- </appender>
- -->
- <!-- EELF Policy Appender. This appender is used to record Policy engine
- related logging events. The Policy logger and appender are specializations
- of the EELF application root logger and appender. This can be used to segregate
- Policy engine events from other components, or it can be eliminated to record
- these events as part of the application root log. -->
- <!--
- <appender name="EELFPolicy"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${policyLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>${logDirectory}/${policyLogName}.%i.log.zip
- </fileNamePattern>
- <minIndex>1</minIndex>
- <maxIndex>9</maxIndex>
- </rollingPolicy>
- <triggeringPolicy
- class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>5MB</maxFileSize>
- </triggeringPolicy>
- <encoder>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- </appender>
- <appender name="asyncEELFPolicy" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="EELFPolicy" />
- </appender>
- -->
- <!-- EELF Audit Appender. This appender is used to record audit engine
- related logging events. The audit logger and appender are specializations
- of the EELF application root logger and appender. This can be used to segregate
- Policy engine events from other components, or it can be eliminated to record
- these events as part of the application root log. -->
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFAudit">
- <file>${logDirectory}/${auditLogName}.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover -->
- <fileNamePattern>${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
- <!-- keep 30 days' worth of history capped at ${totalSizeCap} total size -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>${maxFileSize}</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- </appender>
- <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFAudit">
- <queueSize>${queueSize}</queueSize>
- <appender-ref ref="EELFAudit" />
- </appender>
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFMetrics">
- <file>${logDirectory}/${metricsLogName}.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover -->
- <fileNamePattern>${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
- <!-- keep 30 days' worth of history capped at ${totalSizeCap} total size -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>${maxFileSize}</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- </appender>
- <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFMetrics">
- <queueSize>${queueSize}</queueSize>
- <appender-ref ref="EELFMetrics" />
- </appender>
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFError">
- <file>${logDirectory}/${errorLogName}.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover -->
- <fileNamePattern>${logDirectory}/${errorLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
- <!-- keep 30 days' worth of history capped at ${totalSizeCap} total size -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>${maxFileSize}</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- </appender>
- <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFError">
- <queueSize>${queueSize}</queueSize>
- <appender-ref ref="EELFError" />
- </appender>
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EELFDebug">
- <file>${debugLogDirectory}/${debugLogName}.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover -->
- <fileNamePattern>${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
- <!-- keep 30 days' worth of history capped at ${totalSizeCap} total size -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>${maxFileSize}</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${pattern}</pattern>
- </encoder>
- </appender>
- <appender class="ch.qos.logback.classic.AsyncAppender" name="asyncEELFDebug">
- <queueSize>${queueSize}</queueSize>
- <appender-ref ref="EELFDebug" />
- </appender>
- <!-- ============================================================================ -->
- <!-- EELF loggers -->
- <!-- ============================================================================ -->
- <logger additivity="false" level="debug" name="com.att.eelf">
- <appender-ref ref="asyncEELF" />
- </logger>
- <!--
- <logger name="com.att.eelf.security" level="info" additivity="false">
- <appender-ref ref="asyncEELFSecurity" />
- </logger>
- <logger name="com.att.eelf.perf" level="info" additivity="false">
- <appender-ref ref="asyncEELFPerformance" />
- </logger>
- <logger name="com.att.eelf.server" level="info" additivity="false">
- <appender-ref ref="asyncEELFServer" />
- </logger>
- <logger name="com.att.eelf.policy" level="info" additivity="false">
- <appender-ref ref="asyncEELFPolicy" />
- </logger>
- -->
- <logger additivity="false" level="info" name="com.att.eelf.audit">
- <appender-ref ref="asyncEELFAudit" />
- </logger>
- <logger additivity="false" level="info" name="com.att.eelf.metrics">
- <appender-ref ref="asyncEELFMetrics" />
- </logger>
- <logger additivity="false" level="info" name="com.att.eelf.error">
- <appender-ref ref="asyncEELFError" />
- </logger>
- <logger additivity="false" level="debug" name="com.att.eelf.debug">
- <appender-ref ref="asyncEELFDebug" />
- </logger>
- <root level="DEBUG">
- <appender-ref ref="asyncEELF" />
- </root>
-</configuration>
\ No newline at end of file diff --git a/kubernetes/config/values.yaml b/kubernetes/config/values.yaml index 12dda8de0f..7cfa985c60 100644 --- a/kubernetes/config/values.yaml +++ b/kubernetes/config/values.yaml @@ -3,5 +3,6 @@ nsPrefix: onap dockerSharePath: /dockerdata-nfs image: repository: oomk8s/config-init - tag: 1.1.0 + #master => Beijing (major release uprev) + tag: 2.0.0-SNAPSHOT pullPolicy: Always
\ No newline at end of file diff --git a/kubernetes/portal/templates/portal-mariadb-deployment.yaml b/kubernetes/portal/templates/portal-mariadb-deployment.yaml index 96084e5294..fafcad2772 100755 --- a/kubernetes/portal/templates/portal-mariadb-deployment.yaml +++ b/kubernetes/portal/templates/portal-mariadb-deployment.yaml @@ -29,10 +29,6 @@ spec: readOnly: true - mountPath: /var/lib/mysql name: portal-mariadb-data - - mountPath: /var/log/onap - name: portal-logs - - mountPath: /tmp/logback.xml - name: portal-logback ports: - containerPort: 3306 name: portaldb @@ -41,16 +37,6 @@ spec: port: 3306 initialDelaySeconds: 5 periodSeconds: 10 - - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: filebeat-onap - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - name: filebeat-conf - - mountPath: /var/log/onap - name: portal-logs - - mountPath: /usr/share/filebeat/data - name: portal-data-filebeat volumes: - name: localtime hostPath: @@ -58,16 +44,6 @@ spec: - name: portal-mariadb-data persistentVolumeClaim: claimName: portal-db - - name: filebeat-conf - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml - - name: portal-logs - emptyDir: {} - - name: portal-data-filebeat - emptyDir: {} - - name: portal-logback - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/portal/portal-db/logback.xml imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }}
\ No newline at end of file +#{{ end }} diff --git a/kubernetes/sdnc/templates/all-services.yaml b/kubernetes/sdnc/templates/all-services.yaml index cfb24bf98a..9425ef4b80 100644 --- a/kubernetes/sdnc/templates/all-services.yaml +++ b/kubernetes/sdnc/templates/all-services.yaml @@ -13,6 +13,22 @@ spec: app: sdnc-dbhost clusterIP: None --- +# Client service for connecting to any MySQL instance for reads. +# Only master: sdnc-dbhost-0 accepts the write request. +apiVersion: v1 +kind: Service +metadata: + name: dbhost-read + namespace: "{{ .Values.nsPrefix }}-sdnc" + labels: + app: sdnc-dbhost +spec: + ports: + - name: sdnc-dbhost + port: 3306 + selector: + app: sdnc-dbhost +--- apiVersion: v1 kind: Service metadata: @@ -26,7 +42,6 @@ spec: selector: app: sdnc-dbhost clusterIP: None -#{{ end }} --- apiVersion: v1 kind: Service @@ -41,7 +56,8 @@ spec: selector: app: sdnc-dbhost clusterIP: None -#{{ if not .Values.disableSdncSdncDgbuilder }} +#{{ end }} +#{{ if not .Values.disableSdncSdnc }} --- apiVersion: v1 kind: Service @@ -59,8 +75,6 @@ spec: type: NodePort selector: app: sdnc-dgbuilder -#{{ end }} -#{{ if not .Values.disableSdncSdnc }} --- apiVersion: v1 kind: Service @@ -91,9 +105,34 @@ spec: port: 8201 targetPort: 8101 nodePort: {{ .Values.nodePortPrefix }}08 + - name: "sdnc-jolokia-port-8080" + port: 8280 + targetPort: 8080 + nodePort: {{ .Values.nodePortPrefix }}46 type: NodePort selector: app: sdnc +--- +kind: Service +apiVersion: v1 +metadata: + name: nfs-provisioner + namespace: "{{ .Values.nsPrefix }}-sdnc" + labels: + app: nfs-provisioner +spec: + ports: + - name: nfs + port: 2049 + - name: mountd + port: 20048 + - name: rpcbind + port: 111 + - name: rpcbind-udp + port: 111 + protocol: UDP + selector: + app: nfs-provisioner #{{ end }} #{{ if not .Values.disableSdncSdncPortal }} --- @@ -124,3 +163,24 @@ spec: selector: app: sdnc-portal #{{ end }} +#{{ if .Values.enableODLCluster }} +--- +apiVersion: v1 +kind: Service +metadata: + name: sdnhost-cluster + namespace: "{{ .Values.nsPrefix }}-sdnc" + labels: + app: sdnc + annotations: + service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" +spec: + ports: + - name: "sdnc-cluster-port" + port: 2550 + clusterIP: None + selector: + app: sdnc + sessionAffinity: None + type: ClusterIP +#{{ end }} diff --git a/kubernetes/sdnc/templates/db-deployment.yaml b/kubernetes/sdnc/templates/db-deployment.yaml deleted file mode 100644 index e2723b5e45..0000000000 --- a/kubernetes/sdnc/templates/db-deployment.yaml +++ /dev/null @@ -1,48 +0,0 @@ -#{{ if not .Values.disableSdncSdncDbhost }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: sdnc-dbhost - namespace: "{{ .Values.nsPrefix }}-sdnc" -spec: - selector: - matchLabels: - app: sdnc-dbhost - template: - metadata: - labels: - app: sdnc-dbhost - name: sdnc-dbhost - spec: - containers: - - env: - - name: MYSQL_ROOT_PASSWORD - value: openECOMP1.0 - - name: MYSQL_ROOT_HOST - value: '%' - image: {{ .Values.image.mysqlServer }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: sdnc-db-container - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /var/lib/mysql - name: sdnc-data - ports: - - containerPort: 3306 - readinessProbe: - tcpSocket: - port: 3306 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: sdnc-data - persistentVolumeClaim: - claimName: sdnc-db - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }}
\ No newline at end of file diff --git a/kubernetes/sdnc/templates/db-statefulset.yaml b/kubernetes/sdnc/templates/db-statefulset.yaml new file mode 100644 index 0000000000..f2e079d76e --- /dev/null +++ b/kubernetes/sdnc/templates/db-statefulset.yaml @@ -0,0 +1,193 @@ +#{{ if not .Values.disableSdncSdncDbhost }} +apiVersion: apps/v1beta1 +kind: StatefulSet +metadata: + name: sdnc-dbhost + namespace: "{{ .Values.nsPrefix }}-sdnc" +spec: + serviceName: "dbhost" + replicas: {{ .Values.numberOfDbReplicas }} + selector: + matchLabels: + app: sdnc-dbhost + template: + metadata: + labels: + app: sdnc-dbhost + name: sdnc-dbhost + spec: + initContainers: + - name: init-mysql + image: {{ .Values.image.mysql }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: + - bash + - "-c" + - | + set -ex + # Generate mysql server-id from pod ordinal index. + [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 + ordinal=${BASH_REMATCH[1]} + echo BASH_REMATCH=${BASH_REMATCH} + echo [mysqld] > /mnt/conf.d/server-id.cnf + # Add an offset to avoid reserved server-id=0 value. + echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf + # Copy appropriate conf.d files from config-map to emptyDir. + if [[ $ordinal -eq 0 ]]; then + cp /mnt/config-map/master.cnf /mnt/conf.d/ + else + cp /mnt/config-map/slave.cnf /mnt/conf.d/ + fi + volumeMounts: + - name: conf + mountPath: /mnt/conf.d + - name: config-map + mountPath: /mnt/config-map + - name: clone-mysql + image: {{ .Values.image.xtrabackup }} + env: + - name: MYSQL_ROOT_PASSWORD + value: openECOMP1.0 + command: + - bash + - "-c" + - | + set -ex + # Skip the clone if data already exists. + [[ -d /var/lib/mysql/mysql ]] && exit 0 + # Skip the clone on master (ordinal index 0). + [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 + ordinal=${BASH_REMATCH[1]} + echo ${BASH_REMATCH} + [[ $ordinal -eq 0 ]] && exit 0 + # Clone data from previous peer. + ncat --recv-only sdnc-dbhost-$(($ordinal-1)).dbhost.{{ .Values.nsPrefix }}-sdnc 3307 | xbstream -x -C /var/lib/mysql + # Prepare the backup. + xtrabackup --user=root --password=$MYSQL_ROOT_PASSWORD --prepare --target-dir=/var/lib/mysql + ls -l /var/lib/mysql + volumeMounts: + - name: sdnc-data + mountPath: /var/lib/mysql + subPath: mysql + - name: conf + mountPath: /etc/mysql/conf.d + containers: + - env: + - name: MYSQL_ROOT_PASSWORD + value: openECOMP1.0 + - name: MYSQL_ROOT_HOST + value: '%' + - name: MYSQL_ALLOW_EMPTY_PASSWORD + value: "0" + image: {{ .Values.image.mysql }} + imagePullPolicy: {{ .Values.pullPolicy }} + name: sdnc-db-container + volumeMounts: + - mountPath: /var/lib/mysql + name: sdnc-data + subPath: mysql + - name: conf + mountPath: /etc/mysql/conf.d + ports: + - containerPort: 3306 + resources: + requests: + cpu: 500m + memory: 1Gi + livenessProbe: + exec: + command: ["mysqladmin", "ping"] + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + readinessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 5 + periodSeconds: 10 + - name: xtrabackup + image: {{ .Values.image.xtrabackup }} + env: + - name: MYSQL_ROOT_PASSWORD + value: openECOMP1.0 + ports: + - name: xtrabackup + containerPort: 3307 + command: + - bash + - "-c" + - | + set -ex + cd /var/lib/mysql + ls -l + # Determine binlog position of cloned data, if any. + if [[ -f xtrabackup_slave_info ]]; then + echo "Inside xtrabackup_slave_info" + # XtraBackup already generated a partial "CHANGE MASTER TO" query + # because we're cloning from an existing slave. + mv xtrabackup_slave_info change_master_to.sql.in + # Ignore xtrabackup_binlog_info in this case (it's useless). + rm -f xtrabackup_binlog_info + elif [[ -f xtrabackup_binlog_info ]]; then + echo "Inside xtrabackup_binlog_info" + # We're cloning directly from master. Parse binlog position. + [[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1 + rm xtrabackup_binlog_info + echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\ + MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in + fi + + # Check if we need to complete a clone by starting replication. + if [[ -f change_master_to.sql.in ]]; then + echo "Waiting for mysqld to be ready (accepting connections)" + [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 + ordinal=${BASH_REMATCH[1]} + echo $ordinal + until mysql --user=root --password=$MYSQL_ROOT_PASSWORD -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done + + echo "Initializing replication from clone position" + # In case of container restart, attempt this at-most-once. + mv change_master_to.sql.in change_master_to.sql.orig + mysql --user=root --password=$MYSQL_ROOT_PASSWORD -h 127.0.0.1 <<EOF + $(<change_master_to.sql.orig), + MASTER_HOST="sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}-sdnc", + MASTER_USER="root", + MASTER_PASSWORD="$MYSQL_ROOT_PASSWORD", + MASTER_CONNECT_RETRY=10; + START SLAVE; + EOF + fi + + # Start a server to send backups when requested by peers. + exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \ + "xtrabackup --user=root --password=$MYSQL_ROOT_PASSWORD --backup --slave-info --stream=xbstream --host=127.0.0.1" + volumeMounts: + - name: sdnc-data + mountPath: /var/lib/mysql + subPath: mysql + - name: conf + mountPath: /etc/mysql/conf.d + resources: + requests: + cpu: 100m + memory: 100Mi + volumes: + - name: conf + emptyDir: {} + - name: config-map + configMap: + name: mysql + - name: localtime + hostPath: + path: /etc/localtime + volumeClaimTemplates: + - metadata: + name: sdnc-data + annotations: + volume.beta.kubernetes.io/storage-class: "{{ .Values.nsPrefix }}-sdnc-data" + spec: + accessModes: ["ReadWriteMany"] + resources: + requests: + storage: 1Gi +#{{ end }} diff --git a/kubernetes/sdnc/templates/mysql-configmap.yaml b/kubernetes/sdnc/templates/mysql-configmap.yaml new file mode 100644 index 0000000000..deaa997f02 --- /dev/null +++ b/kubernetes/sdnc/templates/mysql-configmap.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: mysql + namespace: "{{ .Values.nsPrefix }}-sdnc" + labels: + app: mysql +data: + master.cnf: | + # Apply this config only on the master. + [mysqld] + log-bin + [localpathprefix] + master + slave.cnf: | + # Apply this config only on slaves. + [mysqld] + super-read-only + [localpathprefix] + slave diff --git a/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml b/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml new file mode 100644 index 0000000000..9d3feeff9c --- /dev/null +++ b/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml @@ -0,0 +1,55 @@ +#{{ if not .Values.disableSdncSdncDbhost }} +kind: Deployment +apiVersion: extensions/v1beta1 +metadata: + name: nfs-provisioner + namespace: "{{ .Values.nsPrefix }}-sdnc" +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + labels: + app: nfs-provisioner + spec: + containers: + - name: nfs-provisioner + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + ports: + - name: nfs + containerPort: 2049 + - name: mountd + containerPort: 20048 + - name: rpcbind + containerPort: 111 + - name: rpcbind-udp + containerPort: 111 + protocol: UDP + securityContext: + capabilities: + add: + - DAC_READ_SEARCH + - SYS_RESOURCE + args: + - "-provisioner=sdnc/nfs" + env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SERVICE_NAME + value: nfs-provisioner + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + imagePullPolicy: "IfNotPresent" + volumeMounts: + - name: export-volume + mountPath: /export + volumes: + - name: export-volume + hostPath: + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdnc/data +#{{ end }} diff --git a/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml b/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml new file mode 100644 index 0000000000..7c46cf4a68 --- /dev/null +++ b/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml @@ -0,0 +1,8 @@ +#{{ if not .Values.disableSdncSdncDbhost }} +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: "{{ .Values.nsPrefix }}-sdnc-data" + namespace: "{{ .Values.nsPrefix }}-sdnc" +provisioner: sdnc/nfs +#{{ end }} diff --git a/kubernetes/sdnc/templates/sdnc-pv-pvc.yaml b/kubernetes/sdnc/templates/sdnc-pv-pvc.yaml deleted file mode 100644 index f45d8f817d..0000000000 --- a/kubernetes/sdnc/templates/sdnc-pv-pvc.yaml +++ /dev/null @@ -1,32 +0,0 @@ -#{{ if not .Values.disableSdncSdncDbhost }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: "{{ .Values.nsPrefix }}-sdnc-db" - namespace: "{{ .Values.nsPrefix }}-sdnc" - labels: - name: "{{ .Values.nsPrefix }}-sdnc-db" -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdnc/data ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: sdnc-db - namespace: "{{ .Values.nsPrefix }}-sdnc" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: "{{ .Values.nsPrefix }}-sdnc-db" -#{{ end }}
\ No newline at end of file diff --git a/kubernetes/sdnc/templates/sdnc-deployment.yaml b/kubernetes/sdnc/templates/sdnc-statefulset.yaml index 1c88fffea9..3ba37af197 100644 --- a/kubernetes/sdnc/templates/sdnc-deployment.yaml +++ b/kubernetes/sdnc/templates/sdnc-statefulset.yaml @@ -1,10 +1,13 @@ #{{ if not .Values.disableSdncSdnc }} -apiVersion: extensions/v1beta1 -kind: Deployment +apiVersion: apps/v1beta1 +kind: StatefulSet metadata: name: sdnc namespace: "{{ .Values.nsPrefix }}-sdnc" spec: + serviceName: "sdnhost-cluster" + replicas: {{ .Values.numberOfODLReplicas }} + podManagementPolicy: Parallel selector: matchLabels: app: sdnc @@ -31,12 +34,21 @@ spec: name: sdnc-readiness containers: - command: - - /opt/onap/sdnc/bin/startODL.sh + - bash + - "-c" + - | + sed -i 's/dbhost/sdnc-dbhost-0.dbhost.onap-sdnc.svc.cluster.local/g' /opt/onap/sdnc/data/properties/svclogic.properties + sed -i 's/^\(org.onap.ccsdk.sli.jdbc.hosts=\).*/\1sdnc-dbhost-0.dbhost.onap-sdnc.svc.cluster.local/' /opt/onap/sdnc/data/properties/dblib.properties + /opt/onap/sdnc/bin/startODL.sh env: - name: MYSQL_ROOT_PASSWORD value: openECOMP1.0 - name: SDNC_CONFIG_DIR value: /opt/onap/sdnc/data/properties + - name: ENABLE_ODL_CLUSTER + value: "{{ .Values.enableODLCluster }}" + - name: SDNC_REPLICAS + value: "{{ .Values.numberOfODLReplicas }}" image: {{ .Values.image.sdnc }} imagePullPolicy: {{ .Values.pullPolicy }} name: sdnc-controller-container @@ -55,6 +67,8 @@ spec: ports: - containerPort: 8181 - containerPort: 8101 + - containerPort: 2550 + - containerPort: 8080 readinessProbe: tcpSocket: port: 8181 diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml index 407d047850..d04ff84cbd 100644 --- a/kubernetes/sdnc/values.yaml +++ b/kubernetes/sdnc/values.yaml @@ -3,13 +3,19 @@ pullPolicy: Always nodePortPrefix: 302 image: readiness: oomk8s/readiness-check:1.0.0 - mysqlServer: mysql/mysql-server:5.6 + mysql: mysql:5.7 + xtrabackup: gcr.io/google-samples/xtrabackup:1.0 dgbuilderSdnc: nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:v0.1.0 sdnc: nexus3.onap.org:10001/onap/sdnc-image:v1.2.1 admportalSdnc: nexus3.onap.org:10001/onap/admportal-sdnc-image:v1.2.1 filebeat: docker.elastic.co/beats/filebeat:5.5.0 +enableODLCluster: false +numberOfODLReplicas: 1 +numberOfDbReplicas: 1 +disableSdncSdncDgbuilder: false +disableSdncSdncPortal: false # FIXME # Missing the following deps # nexus3.onap.org:10001/onap/sdnc-dmaap-listener-image:v1.2.1 -# nexus3.onap.org:10001/onap/sdnc-ueb-listener-image:v1.2.1
\ No newline at end of file +# nexus3.onap.org:10001/onap/sdnc-ueb-listener-image:v1.2.1 |