Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
add operator livelinessProbe
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolai86 committed Sep 3, 2017
1 parent 717d110 commit 3a46358
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions k8s/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ spec:
- name: couchdb-operator
image: nicolai86/couchdb-operator:v0.0.1
imagePullPolicy: Always
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
env:
- name: OPERATOR_NAMESPACE
valueFrom:
Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/nicolai86/couchdb-operator/probe"
"github.com/nicolai86/couchdb-operator/spec"
"github.com/nicolai86/couchdb-operator/version"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -336,6 +337,12 @@ func main() {
})
controller.Run(nil)
}

probe.SetReady()

sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt)
<-sig
}

func couchdbContainer(baseImage, version string) apiv1.Container {
Expand Down

0 comments on commit 3a46358

Please sign in to comment.