You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/sentinel/sentinel.go
+36-13Lines changed: 36 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,11 @@ var cmdSentinel = &cobra.Command{
50
50
Run:sentinel,
51
51
}
52
52
53
+
const (
54
+
storeDiscovery="store"
55
+
kubernetesDiscovery="kubernetes"
56
+
)
57
+
53
58
typeconfigstruct {
54
59
storeBackendstring
55
60
storeEndpointsstring
@@ -60,6 +65,7 @@ type config struct {
60
65
keeperKubeLabelSelectorstring
61
66
initialClusterConfigstring
62
67
kubernetesNamespacestring
68
+
discoveryTypestring
63
69
debugbool
64
70
}
65
71
@@ -74,7 +80,8 @@ func init() {
74
80
cmdSentinel.PersistentFlags().StringVar(&cfg.keeperKubeLabelSelector,"keeper-kube-label-selector","","label selector for discoverying stolon-keeper(s) under kubernetes")
75
81
cmdSentinel.PersistentFlags().StringVar(&cfg.keeperPort,"keeper-port","5431","stolon-keeper(s) listening port (used by kubernetes discovery)")
76
82
cmdSentinel.PersistentFlags().StringVar(&cfg.initialClusterConfig,"initial-cluster-config","","a file providing the initial cluster config, used only at cluster initialization, ignored if cluster is already initialized")
77
-
cmdSentinel.PersistentFlags().StringVar(&cfg.kubernetesNamespace,"kubernetes-namespace","default","the Kubernetes namespace stolon is deployed under")
83
+
cmdSentinel.PersistentFlags().StringVar(&cfg.kubernetesNamespace,"kubernetes-namespace","default","the kubernetes namespace stolon is deployed under")
84
+
cmdSentinel.PersistentFlags().StringVar(&cfg.discoveryType,"discovery-type","","discovery type (store or kubernetes). Default: detected")
Copy file name to clipboardExpand all lines: examples/kubernetes/README.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,15 @@ In the [image](examples/kubernetes/image/docker) directory you'll find the Docke
15
15
`sorintlab/stolon:master` is the one used by the kubernetes definitions in this example.
16
16
For a more stable testing you can use`sorintlab/stolon:latest`
17
17
18
+
###Keepers discovery
19
+
20
+
When running inside a kubernetes cluster then sentinels will use the kubernetes APIs to discover keepers members. If, on your setup, this doesn't work (for example no api service certificates configured or https api serving disabled) you can disable it using the stolon-sentinel`--discovery-type=store` or exporting the`STSENTINEL_DISCOVERY_TYPE=store` environment variable (see the commented variable in the[stolon-sentinel](stolon-sentinel.yaml) replication controller definition.
21
+
18
22
##Cluster setup and tests
19
23
20
24
These example points to a single node etcd cluster on`10.245.1.1:2379` without tls. You can change the ST${COMPONENT}_STORE_ENDPOINTS environment variables in the definitions to point to the right etcd cluster.
Copy file name to clipboardExpand all lines: examples/kubernetes/stolon-sentinel.yaml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@ spec:
19
19
env:
20
20
-name:SENTINEL
21
21
value:"true"
22
+
# Uncomment this if kubernetes discovery doesn't work on your kubernetes cluster (for example no api service certificates configured or https api serving disabled)