change to netty
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-10-21 01:35:29 +02:00
parent 4d319a76d2
commit 6d77a82b9f
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
5 changed files with 61 additions and 3 deletions

View File

@ -27,7 +27,7 @@ apply plugin: 'application'
group 'com.kmlabz.birbnetes' group 'com.kmlabz.birbnetes'
version '0.0.1' version '0.0.1'
mainClassName = "io.ktor.server.tomcat.EngineMain" mainClassName = "io.ktor.server.netty.EngineMain"
sourceSets { sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src'] main.kotlin.srcDirs = main.java.srcDirs = ['src']
@ -44,7 +44,7 @@ repositories {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "io.ktor:ktor-server-tomcat:$ktor_version" implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version" implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "io.ktor:ktor-server-core:$ktor_version" implementation "io.ktor:ktor-server-core:$ktor_version"
implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.google.code.gson:gson:2.8.6'

12
k8s/configmap.yml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: benchmark-service-config
labels:
app: benchmark-service
namespace: birbnetes
data:
PORT: "8080"
BROKER: "mqtt.k8s.kmlabz.com"
USERNAME: birbnetes
PASSWORD: lofasz

30
k8s/deployment.yml Normal file
View File

@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: benchmark-service
namespace: birbnetes
labels:
app: benchmark-service
spec:
replicas: 1
selector:
matchLabels:
app: benchmark-service
strategy:
type: Recreate
template:
metadata:
labels:
app: benchmark-service
spec:
containers:
- image: registry.kmlabz.com/birbnetes/benchmark-service
imagePullPolicy: Always
name: benchmark-service
envFrom:
- configMapRef:
name: benchmark-service-config
ports:
- containerPort: 8080
imagePullSecrets:
- name: regcred

16
k8s/service.yml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: benchmark-service
namespace: birbnetes
labels:
app: benchmark-service
spec:
ports:
- name: benchmark-service
port: 80
targetPort: 8080
protocol: TCP
selector:
app: benchmark-service
type: ClusterIP

View File

@ -14,7 +14,7 @@ import org.eclipse.paho.client.mqttv3.MqttMessage
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence
fun main(args: Array<String>): Unit = io.ktor.server.tomcat.EngineMain.main(args) fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)
@KtorExperimentalAPI @KtorExperimentalAPI
@Suppress("unused") // Referenced in application.conf @Suppress("unused") // Referenced in application.conf