This file contains hidden or 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
| FROM golang | |
| COPY . /code | |
| ENV GO111MODULE on | |
| WORKDIR /code | |
| RUN ["go", "run", "-mod=vendor", "main.go"] |
This file contains hidden or 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
| // Command contains the app command | |
| var Command = &cobra.Command{ | |
| Use: "app", | |
| Short: "Run the application", | |
| Run: func(cmd *cobra.Command, args []string) { | |
| var s app.Specification | |
| envconfig.MustProcess("", &s) | |
| if err := probe.Create(); err != nil { | |
| panic(err) |
This file contains hidden or 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
| livenessProbe: | |
| exec: | |
| command: | |
| - cat | |
| - /tmp/live | |
| readinessProbe: | |
| httpGet: | |
| path: /health | |
| port: 80 |
This file contains hidden or 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
| package live | |
| import ( | |
| "os" | |
| "github.com/overhq/over-stories-api/pkg/probe" | |
| "github.com/spf13/cobra" | |
| ) | |
| // Command contains the livee command |
This file contains hidden or 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
| package probe | |
| import "os" | |
| const liveFile = "/tmp/live" | |
| // Create will create a file for the liveness check | |
| func Create() error { | |
| _, err := os.Create(liveFile) | |
| return err |
This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) |
This file contains hidden or 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
| livenessProbe: | |
| httpGet: | |
| path: /health | |
| port: 80 | |
| readinessProbe: | |
| httpGet: | |
| path: /health | |
| port: 80 |
This file contains hidden or 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
| package main | |
| import ( | |
| "net/http" | |
| "github.com/go-chi/chi" | |
| "github.com/go-chi/chi/middleware" | |
| ) | |
| func main() { |
This file contains hidden or 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
| foo: bar |
This file contains hidden or 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: my-service | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: my-app | |
| strategy: |
NewerOlder