Skip to content

Instantly share code, notes, and snippets.

@brettneese brettneese/k8s.yaml
Created Mar 20, 2019

Embed
What would you like to do?
apiVersion: apps/v1
kind: Deployment
metadata:
name: odkaggregate-deployment
labels:
app: odkaggregate
spec:
replicas: 1
selector:
matchLabels:
app: odkaggregate
template:
metadata:
labels:
app: odkaggregate
spec:
volumes:
- name: config-volume
secret:
secretName: odkaggregate-config
containers:
- name: odkaggregate
image: aggregate:v2.0.1-12-gbd040e50-dirty
volumeMounts:
- name: config-volume
mountPath: /etc/config
ports:
- containerPort: 8080
---
kind: Secret
apiVersion: v1
metadata:
name: odkaggregate-config
type: Opaque
stringData:
jdbc.properties: |
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.resourceName=jdbc/odk_aggregate
jdbc.url=jdbc:mysql://odk-staging.mysql.database.azure.com:3306/aggregate?useSSL=true&requireSSL=false
jdbc.username=aggregate@odk-staging.mysql.database.azure.com
jdbc.password=password
jdbc.schema=aggregate
security.properties: |
security.server.deviceAuthentication=digest
security.server.secureChannelType=REQUIRES_INSECURE_CHANNEL
security.server.channelType=REQUIRES_INSECURE_CHANNEL
security.server.forceHttpsLinks=false
security.server.hostname=
security.server.port=8080
security.server.securePort=8443
security.server.superUserUsername=administrator
security.server.realm.realmString=ODK Aggregate
odk-settings.xml: |
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.1.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
<value>classpath:security.properties</value>
<value>classpath:logging.properties</value>
</list>
</property>
</bean>
<!--Datasource configuration-->
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="maxIdle" value="10"/>
<property name="minIdle" value="5"/>
<property name="maxTotal" value="100"/>
<property name="maxConnLifetimeMillis" value="590000"/>
<property name="maxWaitMillis" value="30000"/>
<property name="validationQuery" value="select schema_name from information_schema.schemata limit 1"/>
<property name="validationQueryTimeout" value="1"/>
<property name="testOnBorrow" value="true"/>
</bean>
<bean id="datastore" class="org.opendatakit.common.persistence.engine.mysql.DatastoreImpl">
<property name="dataSource" ref="dataSource"/>
<property name="schemaName" value="${jdbc.schema}"/>
</bean>
<!-- Website domain information -->
<bean id="realm" class="org.opendatakit.common.security.Realm">
<property name="isGaeEnvironment" value="false"/>
<property name="realmString" value="${security.server.realm.realmString}"/>
<property name="hostname" value="${security.server.hostname}"/>
<property name="port" value="${security.server.port}"/>
<property name="securePort" value="${security.server.securePort}"/>
<property name="channelType" value="${security.server.channelType}"/>
<property name="secureChannelType" value="${security.server.secureChannelType}"/>
<property name="forceHttpsLinks" value="${security.server.forceHttpsLinks:false}"/>
<property name="checkHostnames" value="${security.server.checkHostnames:true}"/>
</bean>
<bean id="user_service" class="org.opendatakit.common.security.spring.UserServiceImpl">
<property name="datastore" ref="datastore"/>
<property name="realm" ref="realm"/>
<property name="superUserEmail" value=""/>
<property name="superUserUsername" value="${security.server.superUserUsername}"/>
</bean>
<!-- bean to get the siteKey value (which is defined the first time the app starts up) -->
<bean id="sitePreferencesBean" class="org.opendatakit.aggregate.server.SitePreferencesBean">
<property name="datastore" ref="datastore"/>
<property name="userService" ref="user_service"/>
</bean>
<!-- change the background scheduler to only have three worker threads. Tasks will be queued. -->
<task:scheduler id="task_scheduler" pool-size="3"/>
<bean id="worksheet_creator" class="org.opendatakit.aggregate.task.WorksheetCreator"/>
<bean id="form_delete" class="org.opendatakit.aggregate.task.FormDelete"/>
<bean id="purge_submissions" class="org.opendatakit.aggregate.task.PurgeOlderSubmissions"/>
<bean id="upload_task" class="org.opendatakit.aggregate.task.UploadSubmissions"/>
<bean id="kml_task" class="org.opendatakit.aggregate.task.KmlGenerator"/>
<bean id="csv_task" class="org.opendatakit.aggregate.task.CsvGenerator"/>
<bean id="json_file_task" class="org.opendatakit.aggregate.task.JsonFileGenerator"/>
<bean id="http_client_factory" class="org.opendatakit.common.utils.HttpClientFactory"/>
<bean id="image_util" class="org.opendatakit.aggregate.util.ImageUtil"/>
<bean id="startup" class="org.opendatakit.aggregate.AggregateStartupImpl"/>
<bean id="oob_user_fetcher" class="org.opendatakit.common.utils.OutOfBandUserFetcher"/>
<bean id="watchdog" class="org.opendatakit.aggregate.task.Watchdog">
<property name="datastore" ref="datastore"/>
<property name="userService" ref="user_service"/>
<property name="taskScheduler" ref="task_scheduler"/>
<property name="worksheetCreator" ref="worksheet_creator"/>
<property name="purgeSubmissions" ref="purge_submissions"/>
<property name="formDelete" ref="form_delete"/>
<property name="uploadSubmissions" ref="upload_task"/>
<property name="kmlGenerator" ref="kml_task"/>
<property name="csvGenerator" ref="csv_task"/>
<property name="jsonFileGenerator" ref="json_file_task"/>
<property name="httpClientFactory" ref="http_client_factory"/>
<property name="imageUtil" ref="image_util"/>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.