khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 16 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 17 | package config |
| 18 | |
| 19 | import ( |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 20 | "flag" |
| 21 | "fmt" |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 22 | |
Girish Kumar | 4d3887d | 2019-11-22 14:22:05 +0000 | [diff] [blame] | 23 | "time" |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 24 | |
serkant.uluderya | 2ae470f | 2020-01-21 11:13:09 -0800 | [diff] [blame] | 25 | "github.com/opencord/voltha-lib-go/v3/pkg/log" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 26 | ) |
| 27 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 28 | // RW Core service default constants |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 29 | const ( |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 30 | ConsulStoreName = "consul" |
| 31 | EtcdStoreName = "etcd" |
| 32 | defaultGrpcPort = 50057 |
| 33 | defaultGrpcHost = "" |
| 34 | defaultKafkaAdapterHost = "127.0.0.1" |
| 35 | defaultKafkaAdapterPort = 9092 |
| 36 | defaultKafkaClusterHost = "127.0.0.1" |
| 37 | defaultKafkaClusterPort = 9094 |
| 38 | defaultKVStoreType = EtcdStoreName |
| 39 | defaultKVStoreTimeout = 5 //in seconds |
| 40 | defaultKVStoreHost = "127.0.0.1" |
| 41 | defaultKVStorePort = 2379 // Consul = 8500; Etcd = 2379 |
| 42 | defaultKVTxnKeyDelTime = 60 |
| 43 | defaultKVStoreDataPrefix = "service/voltha" |
Rohan Agrawal | 7f72f0c | 2020-01-14 12:05:51 +0000 | [diff] [blame] | 44 | defaultLogLevel = "DEBUG" |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 45 | defaultBanner = false |
| 46 | defaultDisplayVersionOnly = false |
| 47 | defaultCoreTopic = "rwcore" |
| 48 | defaultRWCoreEndpoint = "rwcore" |
| 49 | defaultRWCoreKey = "pki/voltha.key" |
| 50 | defaultRWCoreCert = "pki/voltha.crt" |
| 51 | defaultRWCoreCA = "pki/voltha-CA.pem" |
| 52 | defaultAffinityRouterTopic = "affinityRouter" |
| 53 | defaultInCompetingMode = true |
| 54 | defaultLongRunningRequestTimeout = int64(2000) |
| 55 | defaultDefaultRequestTimeout = int64(500) |
| 56 | defaultCoreTimeout = int64(500) |
| 57 | defaultCoreBindingKey = "voltha_backend_name" |
| 58 | defaultCorePairTopic = "rwcore_1" |
| 59 | defaultMaxConnectionRetries = -1 // retries forever |
| 60 | defaultConnectionRetryInterval = 2 * time.Second |
| 61 | defaultLiveProbeInterval = 60 * time.Second |
| 62 | defaultNotLiveProbeInterval = 5 * time.Second // Probe more frequently when not alive |
| 63 | defaultProbeHost = "" |
| 64 | defaultProbePort = 8080 |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 65 | ) |
| 66 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 67 | // RWCoreFlags represents the set of configurations used by the read-write core service |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 68 | type RWCoreFlags struct { |
| 69 | // Command line parameters |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 70 | RWCoreEndpoint string |
| 71 | GrpcHost string |
| 72 | GrpcPort int |
| 73 | KafkaAdapterHost string |
| 74 | KafkaAdapterPort int |
| 75 | KafkaClusterHost string |
| 76 | KafkaClusterPort int |
| 77 | KVStoreType string |
| 78 | KVStoreTimeout int // in seconds |
| 79 | KVStoreHost string |
| 80 | KVStorePort int |
| 81 | KVTxnKeyDelTime int |
| 82 | KVStoreDataPrefix string |
| 83 | CoreTopic string |
Rohan Agrawal | 7f72f0c | 2020-01-14 12:05:51 +0000 | [diff] [blame] | 84 | LogLevel string |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 85 | Banner bool |
David K. Bainbridge | f430cd5 | 2019-05-28 15:00:35 -0700 | [diff] [blame] | 86 | DisplayVersionOnly bool |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 87 | RWCoreKey string |
| 88 | RWCoreCert string |
| 89 | RWCoreCA string |
| 90 | AffinityRouterTopic string |
| 91 | InCompetingMode bool |
khenaidoo | b608032 | 2019-01-29 21:47:38 -0500 | [diff] [blame] | 92 | LongRunningRequestTimeout int64 |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 93 | DefaultRequestTimeout int64 |
| 94 | DefaultCoreTimeout int64 |
| 95 | CoreBindingKey string |
Kent Hagerman | a6d0c36 | 2019-07-30 12:50:21 -0400 | [diff] [blame] | 96 | CorePairTopic string |
khenaidoo | b324421 | 2019-08-27 14:32:27 -0400 | [diff] [blame] | 97 | MaxConnectionRetries int |
Girish Kumar | 4d3887d | 2019-11-22 14:22:05 +0000 | [diff] [blame] | 98 | ConnectionRetryInterval time.Duration |
| 99 | LiveProbeInterval time.Duration |
| 100 | NotLiveProbeInterval time.Duration |
Kent Hagerman | c461883 | 2019-10-07 12:24:36 -0400 | [diff] [blame] | 101 | ProbeHost string |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 102 | ProbePort int |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 103 | } |
| 104 | |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 105 | func init() { |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 106 | _, err := log.AddPackage(log.JSON, log.WarnLevel, nil) |
| 107 | if err != nil { |
| 108 | log.Errorw("unable-to-register-a-package-to-the-log-map", log.Fields{"error": err}) |
| 109 | } |
khenaidoo | b920354 | 2018-09-17 22:56:37 -0400 | [diff] [blame] | 110 | } |
| 111 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 112 | // NewRWCoreFlags returns a new RWCore config |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 113 | func NewRWCoreFlags() *RWCoreFlags { |
| 114 | var rwCoreFlag = RWCoreFlags{ // Default values |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 115 | RWCoreEndpoint: defaultRWCoreEndpoint, |
| 116 | GrpcHost: defaultGrpcHost, |
| 117 | GrpcPort: defaultGrpcPort, |
| 118 | KafkaAdapterHost: defaultKafkaAdapterHost, |
| 119 | KafkaAdapterPort: defaultKafkaAdapterPort, |
| 120 | KafkaClusterHost: defaultKafkaClusterHost, |
| 121 | KafkaClusterPort: defaultKafkaClusterPort, |
| 122 | KVStoreType: defaultKVStoreType, |
| 123 | KVStoreTimeout: defaultKVStoreTimeout, |
| 124 | KVStoreHost: defaultKVStoreHost, |
| 125 | KVStorePort: defaultKVStorePort, |
| 126 | KVStoreDataPrefix: defaultKVStoreDataPrefix, |
| 127 | KVTxnKeyDelTime: defaultKVTxnKeyDelTime, |
| 128 | CoreTopic: defaultCoreTopic, |
| 129 | LogLevel: defaultLogLevel, |
| 130 | Banner: defaultBanner, |
| 131 | DisplayVersionOnly: defaultDisplayVersionOnly, |
| 132 | RWCoreKey: defaultRWCoreKey, |
| 133 | RWCoreCert: defaultRWCoreCert, |
| 134 | RWCoreCA: defaultRWCoreCA, |
| 135 | AffinityRouterTopic: defaultAffinityRouterTopic, |
| 136 | InCompetingMode: defaultInCompetingMode, |
| 137 | DefaultRequestTimeout: defaultDefaultRequestTimeout, |
| 138 | LongRunningRequestTimeout: defaultLongRunningRequestTimeout, |
| 139 | DefaultCoreTimeout: defaultCoreTimeout, |
| 140 | CoreBindingKey: defaultCoreBindingKey, |
| 141 | CorePairTopic: defaultCorePairTopic, |
| 142 | MaxConnectionRetries: defaultMaxConnectionRetries, |
| 143 | ConnectionRetryInterval: defaultConnectionRetryInterval, |
| 144 | LiveProbeInterval: defaultLiveProbeInterval, |
| 145 | NotLiveProbeInterval: defaultNotLiveProbeInterval, |
| 146 | ProbeHost: defaultProbeHost, |
| 147 | ProbePort: defaultProbePort, |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 148 | } |
| 149 | return &rwCoreFlag |
| 150 | } |
| 151 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 152 | // ParseCommandArguments parses the arguments when running read-write core service |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 153 | func (cf *RWCoreFlags) ParseCommandArguments() { |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 154 | |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 155 | help := fmt.Sprintf("RW core endpoint address") |
| 156 | flag.StringVar(&(cf.RWCoreEndpoint), "vcore-endpoint", defaultRWCoreEndpoint, help) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 157 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 158 | help = fmt.Sprintf("GRPC server - host") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 159 | flag.StringVar(&(cf.GrpcHost), "grpc_host", defaultGrpcHost, help) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 160 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 161 | help = fmt.Sprintf("GRPC server - port") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 162 | flag.IntVar(&(cf.GrpcPort), "grpc_port", defaultGrpcPort, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 163 | |
| 164 | help = fmt.Sprintf("Kafka - Adapter messaging host") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 165 | flag.StringVar(&(cf.KafkaAdapterHost), "kafka_adapter_host", defaultKafkaAdapterHost, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 166 | |
| 167 | help = fmt.Sprintf("Kafka - Adapter messaging port") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 168 | flag.IntVar(&(cf.KafkaAdapterPort), "kafka_adapter_port", defaultKafkaAdapterPort, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 169 | |
| 170 | help = fmt.Sprintf("Kafka - Cluster messaging host") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 171 | flag.StringVar(&(cf.KafkaClusterHost), "kafka_cluster_host", defaultKafkaClusterHost, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 172 | |
| 173 | help = fmt.Sprintf("Kafka - Cluster messaging port") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 174 | flag.IntVar(&(cf.KafkaClusterPort), "kafka_cluster_port", defaultKafkaClusterPort, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 175 | |
| 176 | help = fmt.Sprintf("RW Core topic") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 177 | flag.StringVar(&(cf.CoreTopic), "rw_core_topic", defaultCoreTopic, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 178 | |
khenaidoo | 7923270 | 2018-12-04 11:00:41 -0500 | [diff] [blame] | 179 | help = fmt.Sprintf("Affinity Router topic") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 180 | flag.StringVar(&(cf.AffinityRouterTopic), "affinity_router_topic", defaultAffinityRouterTopic, help) |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 181 | |
| 182 | help = fmt.Sprintf("In competing Mode - two cores competing to handle a transaction ") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 183 | flag.BoolVar(&cf.InCompetingMode, "in_competing_mode", defaultInCompetingMode, help) |
khenaidoo | 7923270 | 2018-12-04 11:00:41 -0500 | [diff] [blame] | 184 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 185 | help = fmt.Sprintf("KV store type") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 186 | flag.StringVar(&(cf.KVStoreType), "kv_store_type", defaultKVStoreType, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 187 | |
| 188 | help = fmt.Sprintf("The default timeout when making a kv store request") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 189 | flag.IntVar(&(cf.KVStoreTimeout), "kv_store_request_timeout", defaultKVStoreTimeout, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 190 | |
| 191 | help = fmt.Sprintf("KV store host") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 192 | flag.StringVar(&(cf.KVStoreHost), "kv_store_host", defaultKVStoreHost, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 193 | |
| 194 | help = fmt.Sprintf("KV store port") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 195 | flag.IntVar(&(cf.KVStorePort), "kv_store_port", defaultKVStorePort, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 196 | |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 197 | help = fmt.Sprintf("The time to wait before deleting a completed transaction key") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 198 | flag.IntVar(&(cf.KVTxnKeyDelTime), "kv_txn_delete_time", defaultKVTxnKeyDelTime, help) |
Richard Jankowski | e4d7766 | 2018-10-17 13:53:21 -0400 | [diff] [blame] | 199 | |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 200 | help = fmt.Sprintf("KV store data prefix") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 201 | flag.StringVar(&(cf.KVStoreDataPrefix), "kv_store_data_prefix", defaultKVStoreDataPrefix, help) |
khenaidoo | 9cdc1a6 | 2019-01-24 21:57:40 -0500 | [diff] [blame] | 202 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 203 | help = fmt.Sprintf("Log level") |
Rohan Agrawal | 7f72f0c | 2020-01-14 12:05:51 +0000 | [diff] [blame] | 204 | flag.StringVar(&(cf.LogLevel), "log_level", defaultLogLevel, help) |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 205 | |
khenaidoo | b608032 | 2019-01-29 21:47:38 -0500 | [diff] [blame] | 206 | help = fmt.Sprintf("Timeout for long running request") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 207 | flag.Int64Var(&(cf.LongRunningRequestTimeout), "timeout_long_request", defaultLongRunningRequestTimeout, help) |
khenaidoo | b608032 | 2019-01-29 21:47:38 -0500 | [diff] [blame] | 208 | |
| 209 | help = fmt.Sprintf("Default timeout for regular request") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 210 | flag.Int64Var(&(cf.DefaultRequestTimeout), "timeout_request", defaultDefaultRequestTimeout, help) |
khenaidoo | b608032 | 2019-01-29 21:47:38 -0500 | [diff] [blame] | 211 | |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 212 | help = fmt.Sprintf("Default Core timeout") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 213 | flag.Int64Var(&(cf.DefaultCoreTimeout), "core_timeout", defaultCoreTimeout, help) |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 214 | |
khenaidoo | 5c11af7 | 2018-07-20 17:21:05 -0400 | [diff] [blame] | 215 | help = fmt.Sprintf("Show startup banner log lines") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 216 | flag.BoolVar(&cf.Banner, "banner", defaultBanner, help) |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 217 | |
David K. Bainbridge | f430cd5 | 2019-05-28 15:00:35 -0700 | [diff] [blame] | 218 | help = fmt.Sprintf("Show version information and exit") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 219 | flag.BoolVar(&cf.DisplayVersionOnly, "version", defaultDisplayVersionOnly, help) |
David K. Bainbridge | f430cd5 | 2019-05-28 15:00:35 -0700 | [diff] [blame] | 220 | |
Richard Jankowski | 46464e9 | 2019-03-05 11:53:55 -0500 | [diff] [blame] | 221 | help = fmt.Sprintf("The name of the meta-key whose value is the rw-core group to which the ofagent is bound") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 222 | flag.StringVar(&(cf.CoreBindingKey), "core_binding_key", defaultCoreBindingKey, help) |
Richard Jankowski | 46464e9 | 2019-03-05 11:53:55 -0500 | [diff] [blame] | 223 | |
Kent Hagerman | a6d0c36 | 2019-07-30 12:50:21 -0400 | [diff] [blame] | 224 | help = fmt.Sprintf("Core pairing group topic") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 225 | flag.StringVar(&cf.CorePairTopic, "core_pair_topic", defaultCorePairTopic, help) |
Kent Hagerman | a6d0c36 | 2019-07-30 12:50:21 -0400 | [diff] [blame] | 226 | |
khenaidoo | b324421 | 2019-08-27 14:32:27 -0400 | [diff] [blame] | 227 | help = fmt.Sprintf("The number of retries to connect to a dependent component") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 228 | flag.IntVar(&(cf.MaxConnectionRetries), "max_connection_retries", defaultMaxConnectionRetries, help) |
khenaidoo | b324421 | 2019-08-27 14:32:27 -0400 | [diff] [blame] | 229 | |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 230 | help = fmt.Sprintf("The number of seconds between each connection retry attempt") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 231 | flag.DurationVar(&(cf.ConnectionRetryInterval), "connection_retry_interval", defaultConnectionRetryInterval, help) |
khenaidoo | b324421 | 2019-08-27 14:32:27 -0400 | [diff] [blame] | 232 | |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 233 | help = fmt.Sprintf("The number of seconds between liveness probes while in a live state") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 234 | flag.DurationVar(&(cf.LiveProbeInterval), "live_probe_interval", defaultLiveProbeInterval, help) |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 235 | |
| 236 | help = fmt.Sprintf("The number of seconds between liveness probes while in a not live state") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 237 | flag.DurationVar(&(cf.NotLiveProbeInterval), "not_live_probe_interval", defaultNotLiveProbeInterval, help) |
Scott Baker | ee6a087 | 2019-10-29 15:59:52 -0700 | [diff] [blame] | 238 | |
Kent Hagerman | c461883 | 2019-10-07 12:24:36 -0400 | [diff] [blame] | 239 | help = fmt.Sprintf("The host on which to listen to answer liveness and readiness probe queries over HTTP.") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 240 | flag.StringVar(&(cf.ProbeHost), "probe_host", defaultProbeHost, help) |
Kent Hagerman | c461883 | 2019-10-07 12:24:36 -0400 | [diff] [blame] | 241 | |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 242 | help = fmt.Sprintf("The port on which to listen to answer liveness and readiness probe queries over HTTP.") |
npujar | 1d86a52 | 2019-11-14 17:11:16 +0530 | [diff] [blame] | 243 | flag.IntVar(&(cf.ProbePort), "probe_port", defaultProbePort, help) |
David K. Bainbridge | b4a9ab0 | 2019-09-20 15:12:16 -0700 | [diff] [blame] | 244 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 245 | flag.Parse() |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 246 | } |