This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kubernetes deployment to deploy Sidecar proxy + application in a single pod | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
labels: | |
app: sidecar-proxy-example | |
spec: | |
replicas: 1 | |
selector: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: prometheus-deployment | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
name: prometheus | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -X DELETE mymarathonHost:8080/v2/apps/myapp.v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -X PUT -d '{"id":"myapp.v2", "acl":"path_beg -i /myapp"}' http://localhost:8000/api/services/myapp.v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl mymarathonHost:8080/v2/apps/myapp.v2 /green | jq '.tasks[].healthCheckResults[] | select (.alive == false)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl myMarathonHost:8080/v2/apps -X POST -H 'Content-Type: application/json' -d "{ "container": { \ | |
"type": "DOCKER", \ | |
"docker": { \ | |
"image": "myUser/myapp" \ | |
}, \ | |
"id": "myapp.v2", \ | |
"instances": 1, \ | |
"cpus": 0.5, \ | |
"mem": 512 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example for lukaseichler.de/how-to-test-dispatch-request/ | |
import java.io.InputStream | |
import java.net.URI | |
import java.nio.ByteBuffer | |
import java.util | |
import com.ning.http.client.cookie.Cookie | |
import com.ning.http.client.{ FluentCaseInsensitiveStringsMap, Response } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example for lukaseichler.de/how-to-test-dispatch-request/ | |
import dispatch.{HttpExecutor, _} | |
import dispatch.Defaults._ | |
val httpMock = mock[HttpExecutor] | |
(httpMock.apply(_: (Request, AsyncHandler[String]))(_: ExecutionContext)) | |
.expects(*, *) | |
.returning(Future[String] { | |
"Hello World" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example for lukaseichler.de/how-to-test-dispatch-request/ | |
val filter = unfiltered.filter.Planify { | |
case _ => ResponseString( | |
"Hello World!" | |
) | |
} | |
unfiltered.jetty.Server(8080).plan(filter).run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argonaut._ | |
import Argonaut._ | |
object Main extends App{ | |
val json = "{ \"name\": \"Peter\", \"score\": null}" | |
case class Player(name: String, score: Option[String]) | |
implicit def PlayerCodecJson: CodecJson[Player] = |
NewerOlder