2019-01-09 16:54:15 +00:00
|
|
|
package cmds
|
|
|
|
|
|
|
|
import (
|
2020-08-19 23:54:58 +00:00
|
|
|
"context"
|
|
|
|
|
2020-05-05 22:09:04 +00:00
|
|
|
"github.com/rancher/k3s/pkg/version"
|
2020-08-29 19:46:55 +00:00
|
|
|
"github.com/urfave/cli"
|
2019-01-09 16:54:15 +00:00
|
|
|
)
|
|
|
|
|
2020-04-27 16:45:51 +00:00
|
|
|
const (
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
defaultSnapshotRentention = 5
|
|
|
|
defaultSnapshotIntervalHours = 12
|
2020-04-27 16:45:51 +00:00
|
|
|
)
|
|
|
|
|
2019-01-09 16:54:15 +00:00
|
|
|
type Server struct {
|
2021-02-01 19:11:17 +00:00
|
|
|
ClusterCIDR string
|
|
|
|
AgentToken string
|
|
|
|
AgentTokenFile string
|
|
|
|
Token string
|
|
|
|
TokenFile string
|
|
|
|
ClusterSecret string
|
|
|
|
ServiceCIDR string
|
|
|
|
ServiceNodePortRange string
|
|
|
|
ClusterDNS string
|
|
|
|
ClusterDomain string
|
2020-04-28 22:00:30 +00:00
|
|
|
// The port which kubectl clients can access k8s
|
|
|
|
HTTPSPort int
|
|
|
|
// The port which custom k3s API runs on
|
|
|
|
SupervisorPort int
|
|
|
|
// The port which kube-apiserver runs on
|
|
|
|
APIServerPort int
|
|
|
|
APIServerBindAddress string
|
2019-10-15 21:17:26 +00:00
|
|
|
DataDir string
|
|
|
|
DisableAgent bool
|
|
|
|
KubeConfigOutput string
|
|
|
|
KubeConfigMode string
|
2020-08-29 19:46:55 +00:00
|
|
|
TLSSan cli.StringSlice
|
2019-10-15 21:17:26 +00:00
|
|
|
BindAddress string
|
2020-08-29 19:46:55 +00:00
|
|
|
ExtraAPIArgs cli.StringSlice
|
|
|
|
ExtraSchedulerArgs cli.StringSlice
|
|
|
|
ExtraControllerArgs cli.StringSlice
|
|
|
|
ExtraCloudControllerArgs cli.StringSlice
|
2019-10-15 21:17:26 +00:00
|
|
|
Rootless bool
|
2019-11-16 00:12:27 +00:00
|
|
|
DatastoreEndpoint string
|
|
|
|
DatastoreCAFile string
|
|
|
|
DatastoreCertFile string
|
|
|
|
DatastoreKeyFile string
|
2019-10-15 21:17:26 +00:00
|
|
|
AdvertiseIP string
|
|
|
|
AdvertisePort int
|
|
|
|
DisableScheduler bool
|
2019-10-27 05:53:25 +00:00
|
|
|
ServerURL string
|
2019-10-15 21:17:26 +00:00
|
|
|
FlannelBackend string
|
|
|
|
DefaultLocalStoragePath string
|
|
|
|
DisableCCM bool
|
2019-10-17 21:46:15 +00:00
|
|
|
DisableNPC bool
|
2020-04-27 16:31:25 +00:00
|
|
|
DisableKubeProxy bool
|
2019-10-27 05:53:25 +00:00
|
|
|
ClusterInit bool
|
|
|
|
ClusterReset bool
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
ClusterResetRestorePath string
|
2019-12-12 22:41:10 +00:00
|
|
|
EncryptSecrets bool
|
2020-09-04 16:30:36 +00:00
|
|
|
StartupHooks []func(context.Context, <-chan struct{}, string) error
|
2021-01-21 21:09:15 +00:00
|
|
|
EtcdSnapshotName string
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
EtcdDisableSnapshots bool
|
2021-01-23 01:40:48 +00:00
|
|
|
EtcdExposeMetrics bool
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
EtcdSnapshotDir string
|
|
|
|
EtcdSnapshotCron string
|
|
|
|
EtcdSnapshotRetention int
|
2019-01-09 16:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var ServerConfig Server
|
|
|
|
|
2020-08-29 19:46:55 +00:00
|
|
|
func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
|
|
|
return cli.Command{
|
2019-01-09 16:54:15 +00:00
|
|
|
Name: "server",
|
|
|
|
Usage: "Run management server",
|
|
|
|
UsageText: appName + " server [OPTIONS]",
|
2020-08-30 03:30:07 +00:00
|
|
|
Before: SetupDebug(CheckSELinuxFlags),
|
2020-08-29 19:46:55 +00:00
|
|
|
Action: action,
|
2019-01-09 16:54:15 +00:00
|
|
|
Flags: []cli.Flag{
|
2020-09-03 17:39:46 +00:00
|
|
|
ConfigFlag,
|
|
|
|
DebugFlag,
|
2020-08-29 19:46:55 +00:00
|
|
|
VLevel,
|
|
|
|
VModule,
|
|
|
|
LogFile,
|
|
|
|
AlsoLogToStderr,
|
|
|
|
cli.StringFlag{
|
2019-03-31 00:10:23 +00:00
|
|
|
Name: "bind-address",
|
2020-05-05 22:09:04 +00:00
|
|
|
Usage: "(listener) " + version.Program + " bind address (default: 0.0.0.0)",
|
2019-03-31 00:10:23 +00:00
|
|
|
Destination: &ServerConfig.BindAddress,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.IntFlag{
|
2019-01-09 16:54:15 +00:00
|
|
|
Name: "https-listen-port",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(listener) HTTPS listen port",
|
2019-01-09 16:54:15 +00:00
|
|
|
Value: 6443,
|
|
|
|
Destination: &ServerConfig.HTTPSPort,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "advertise-address",
|
|
|
|
Usage: "(listener) IP address that apiserver uses to advertise to members of the cluster (default: node-external-ip/node-ip)",
|
|
|
|
Destination: &ServerConfig.AdvertiseIP,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.IntFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "advertise-port",
|
|
|
|
Usage: "(listener) Port that apiserver uses to advertise to members of the cluster (default: listen-port)",
|
|
|
|
Destination: &ServerConfig.AdvertisePort,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Name: "tls-san",
|
|
|
|
Usage: "(listener) Add additional hostname or IP as a Subject Alternative Name in the TLS cert",
|
|
|
|
Value: &ServerConfig.TLSSan,
|
2019-01-09 16:54:15 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-01-09 16:54:15 +00:00
|
|
|
Name: "data-dir,d",
|
2020-05-05 22:09:04 +00:00
|
|
|
Usage: "(data) Folder to hold state default /var/lib/rancher/" + version.Program + " or ${HOME}/.rancher/" + version.Program + " if not root",
|
2019-01-09 16:54:15 +00:00
|
|
|
Destination: &ServerConfig.DataDir,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-01-09 16:54:15 +00:00
|
|
|
Name: "cluster-cidr",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(networking) Network CIDR to use for pod IPs",
|
2019-01-09 16:54:15 +00:00
|
|
|
Destination: &ServerConfig.ClusterCIDR,
|
2019-03-04 05:25:02 +00:00
|
|
|
Value: "10.42.0.0/16",
|
2019-01-09 16:54:15 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-03-06 10:37:03 +00:00
|
|
|
Name: "service-cidr",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(networking) Network CIDR to use for services IPs",
|
2019-03-06 10:37:03 +00:00
|
|
|
Destination: &ServerConfig.ServiceCIDR,
|
|
|
|
Value: "10.43.0.0/16",
|
|
|
|
},
|
2021-02-01 19:11:17 +00:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "service-node-port-range",
|
|
|
|
Usage: "(networking) Port range to reserve for services with NodePort visibility",
|
|
|
|
Destination: &ServerConfig.ServiceNodePortRange,
|
|
|
|
Value: "30000-32767",
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-03-06 11:16:04 +00:00
|
|
|
Name: "cluster-dns",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(networking) Cluster IP for coredns service. Should be in your service-cidr range (default: 10.43.0.10)",
|
2019-03-06 11:16:04 +00:00
|
|
|
Destination: &ServerConfig.ClusterDNS,
|
2019-03-06 18:41:07 +00:00
|
|
|
Value: "",
|
2019-03-06 11:16:04 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-04-12 06:06:35 +00:00
|
|
|
Name: "cluster-domain",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(networking) Cluster Domain",
|
2019-04-12 06:06:35 +00:00
|
|
|
Destination: &ServerConfig.ClusterDomain,
|
|
|
|
Value: "cluster.local",
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "flannel-backend",
|
2020-04-30 15:48:12 +00:00
|
|
|
Usage: "(networking) One of 'none', 'vxlan', 'ipsec', 'host-gw', or 'wireguard'",
|
2019-10-27 05:53:25 +00:00
|
|
|
Destination: &ServerConfig.FlannelBackend,
|
2019-11-08 20:56:41 +00:00
|
|
|
Value: "vxlan",
|
2019-10-27 05:53:25 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "token,t",
|
|
|
|
Usage: "(cluster) Shared secret used to join a server or agent to a cluster",
|
|
|
|
Destination: &ServerConfig.Token,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_TOKEN",
|
2019-10-27 05:53:25 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "token-file",
|
|
|
|
Usage: "(cluster) File containing the cluster-secret/token",
|
|
|
|
Destination: &ServerConfig.TokenFile,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_TOKEN_FILE",
|
2019-10-27 05:53:25 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-01-22 21:14:58 +00:00
|
|
|
Name: "write-kubeconfig,o",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(client) Write kubeconfig for admin client to this file",
|
2019-01-22 21:14:58 +00:00
|
|
|
Destination: &ServerConfig.KubeConfigOutput,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_KUBECONFIG_OUTPUT",
|
2019-01-22 21:14:58 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-01-22 21:14:58 +00:00
|
|
|
Name: "write-kubeconfig-mode",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(client) Write kubeconfig with this mode",
|
2019-01-22 21:14:58 +00:00
|
|
|
Destination: &ServerConfig.KubeConfigMode,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_KUBECONFIG_MODE",
|
2019-01-22 21:14:58 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Name: "kube-apiserver-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-apiserver process",
|
|
|
|
Value: &ServerConfig.ExtraAPIArgs,
|
2019-04-05 00:43:00 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Name: "kube-scheduler-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-scheduler process",
|
|
|
|
Value: &ServerConfig.ExtraSchedulerArgs,
|
2019-04-05 00:43:00 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Name: "kube-controller-manager-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-controller-manager process",
|
|
|
|
Value: &ServerConfig.ExtraControllerArgs,
|
2019-04-05 00:43:00 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Name: "kube-cloud-controller-manager-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-cloud-controller-manager process",
|
|
|
|
Value: &ServerConfig.ExtraCloudControllerArgs,
|
2019-10-15 21:17:26 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-16 00:12:27 +00:00
|
|
|
Name: "datastore-endpoint",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(db) Specify etcd, Mysql, Postgres, or Sqlite (default) data source name",
|
2019-11-16 00:12:27 +00:00
|
|
|
Destination: &ServerConfig.DatastoreEndpoint,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_DATASTORE_ENDPOINT",
|
2019-05-15 23:05:24 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-16 00:12:27 +00:00
|
|
|
Name: "datastore-cafile",
|
|
|
|
Usage: "(db) TLS Certificate Authority file used to secure datastore backend communication",
|
|
|
|
Destination: &ServerConfig.DatastoreCAFile,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_DATASTORE_CAFILE",
|
2019-06-11 22:48:47 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-16 00:12:27 +00:00
|
|
|
Name: "datastore-certfile",
|
|
|
|
Usage: "(db) TLS certification file used to secure datastore backend communication",
|
|
|
|
Destination: &ServerConfig.DatastoreCertFile,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_DATASTORE_CERTFILE",
|
2019-06-11 22:48:47 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-16 00:12:27 +00:00
|
|
|
Name: "datastore-keyfile",
|
|
|
|
Usage: "(db) TLS key file used to secure datastore backend communication",
|
|
|
|
Destination: &ServerConfig.DatastoreKeyFile,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_DATASTORE_KEYFILE",
|
2019-06-11 22:48:47 +00:00
|
|
|
},
|
2021-01-23 01:40:48 +00:00
|
|
|
&cli.BoolFlag{
|
|
|
|
Name: "etcd-expose-metrics",
|
|
|
|
Usage: "(db) Expose etcd metrics to client interface. (Default false)",
|
|
|
|
Destination: &ServerConfig.EtcdExposeMetrics,
|
|
|
|
},
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
&cli.BoolFlag{
|
|
|
|
Name: "etcd-disable-snapshots",
|
|
|
|
Usage: "(db) Disable automatic etcd snapshots",
|
|
|
|
Destination: &ServerConfig.EtcdDisableSnapshots,
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
2021-01-21 21:09:15 +00:00
|
|
|
Name: "etcd-snapshot-name",
|
|
|
|
Usage: "(db) Set the base name of etcd snapshots. Default: etcd-snapshot-<unix-timestamp>",
|
|
|
|
Destination: &ServerConfig.EtcdSnapshotName,
|
|
|
|
Value: "etcd-snapshot",
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
Name: "etcd-snapshot-schedule-cron",
|
|
|
|
Usage: "(db) Snapshot interval time in cron spec. eg. every 5 hours '* */5 * * *'",
|
|
|
|
Destination: &ServerConfig.EtcdSnapshotCron,
|
|
|
|
Value: "0 */12 * * *",
|
|
|
|
},
|
|
|
|
&cli.IntFlag{
|
|
|
|
Name: "etcd-snapshot-retention",
|
|
|
|
Usage: "(db) Number of snapshots to retain",
|
|
|
|
Destination: &ServerConfig.EtcdSnapshotRetention,
|
|
|
|
Value: defaultSnapshotRentention,
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "etcd-snapshot-dir",
|
|
|
|
Usage: "(db) Directory to save db snapshots. (Default location: ${data-dir}/db/snapshots)",
|
|
|
|
Destination: &ServerConfig.EtcdSnapshotDir,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "default-local-storage-path",
|
|
|
|
Usage: "(storage) Default local storage path for local provisioner storage class",
|
|
|
|
Destination: &ServerConfig.DefaultLocalStoragePath,
|
2019-05-29 18:53:51 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
2020-01-29 23:40:49 +00:00
|
|
|
Name: "disable",
|
2020-04-27 16:45:51 +00:00
|
|
|
Usage: "(components) Do not deploy packaged components and delete any deployed components (valid items: " + DisableItems + ")",
|
2019-05-29 18:53:51 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-07-12 16:59:03 +00:00
|
|
|
Name: "disable-scheduler",
|
2019-10-27 05:53:25 +00:00
|
|
|
Usage: "(components) Disable Kubernetes default scheduler",
|
2019-07-12 16:59:03 +00:00
|
|
|
Destination: &ServerConfig.DisableScheduler,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-10-15 21:17:26 +00:00
|
|
|
Name: "disable-cloud-controller",
|
2020-05-05 22:09:04 +00:00
|
|
|
Usage: "(components) Disable " + version.Program + " default cloud controller manager",
|
2019-10-15 21:17:26 +00:00
|
|
|
Destination: &ServerConfig.DisableCCM,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2020-04-27 16:31:25 +00:00
|
|
|
Name: "disable-kube-proxy",
|
|
|
|
Usage: "(components) Disable running kube-proxy",
|
|
|
|
Destination: &ServerConfig.DisableKubeProxy,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-10-17 21:46:15 +00:00
|
|
|
Name: "disable-network-policy",
|
2020-05-05 22:09:04 +00:00
|
|
|
Usage: "(components) Disable " + version.Program + " default network policy controller",
|
2019-10-17 21:46:15 +00:00
|
|
|
Destination: &ServerConfig.DisableNPC,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
NodeNameFlag,
|
|
|
|
WithNodeIDFlag,
|
|
|
|
NodeLabels,
|
|
|
|
NodeTaints,
|
|
|
|
DockerFlag,
|
|
|
|
CRIEndpointFlag,
|
|
|
|
PauseImageFlag,
|
|
|
|
SnapshotterFlag,
|
|
|
|
PrivateRegistryFlag,
|
|
|
|
NodeIPFlag,
|
|
|
|
NodeExternalIPFlag,
|
|
|
|
ResolvConfFlag,
|
|
|
|
FlannelIfaceFlag,
|
|
|
|
FlannelConfFlag,
|
|
|
|
ExtraKubeletArgs,
|
|
|
|
ExtraKubeProxyArgs,
|
|
|
|
ProtectKernelDefaultsFlag,
|
|
|
|
cli.BoolFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "rootless",
|
|
|
|
Usage: "(experimental) Run rootless",
|
|
|
|
Destination: &ServerConfig.Rootless,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-11 22:16:46 +00:00
|
|
|
Name: "agent-token",
|
2019-11-14 19:42:42 +00:00
|
|
|
Usage: "(experimental/cluster) Shared secret used to join agents to the cluster, but not servers",
|
2019-11-11 22:16:46 +00:00
|
|
|
Destination: &ServerConfig.AgentToken,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_AGENT_TOKEN",
|
2019-11-11 22:16:46 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-11 22:16:46 +00:00
|
|
|
Name: "agent-token-file",
|
|
|
|
Usage: "(experimental/cluster) File containing the agent secret",
|
|
|
|
Destination: &ServerConfig.AgentTokenFile,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_AGENT_TOKEN_FILE",
|
2019-11-11 22:16:46 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-11-11 22:16:46 +00:00
|
|
|
Name: "server,s",
|
2020-08-24 22:45:01 +00:00
|
|
|
Hidden: hideClusterFlags,
|
2019-11-11 22:16:46 +00:00
|
|
|
Usage: "(experimental/cluster) Server to connect to, used to join a cluster",
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_URL",
|
2019-11-11 22:16:46 +00:00
|
|
|
Destination: &ServerConfig.ServerURL,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-11-11 22:16:46 +00:00
|
|
|
Name: "cluster-init",
|
2020-08-24 22:45:01 +00:00
|
|
|
Hidden: hideClusterFlags,
|
|
|
|
Usage: "(experimental/cluster) Initialize a new cluster",
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_CLUSTER_INIT",
|
2019-11-11 22:16:46 +00:00
|
|
|
Destination: &ServerConfig.ClusterInit,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-11-11 22:16:46 +00:00
|
|
|
Name: "cluster-reset",
|
2020-08-24 22:45:01 +00:00
|
|
|
Hidden: hideClusterFlags,
|
|
|
|
Usage: "(experimental/cluster) Forget all peers and become sole member of a new cluster",
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_CLUSTER_RESET",
|
2019-11-11 22:16:46 +00:00
|
|
|
Destination: &ServerConfig.ClusterReset,
|
|
|
|
},
|
Galal hussein etcd backup restore (#2154)
* Add etcd snapshot and restore
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix error logs
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* goimports
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* fix flag describtion
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* Add disable snapshot and retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* use creation time for snapshot retention
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
* unexport method, update var name
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* adjust snapshot flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var name, string concat
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* revert previous change, create constants
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* type assertion error checking
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* pr remediation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* updates
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* simplify logic, remove unneeded function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update flags
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* exit on restore completion, update flag names, move retention check
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update disable snapshots flag and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* move function
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update var and field names
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update defaultSnapshotIntervalMinutes to 12 like rke
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update directory perms
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update etc-snapshot-dir usage
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update interval to 12 hours
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* fix usage typo
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* add cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* wire in cron
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update deps target to work, add build/data target for creation, and generate
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove dead make targets
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* error handling, cluster reset functionality
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* update
Signed-off-by: Brian Downs <brian.downs@gmail.com>
* remove intermediate dapper file
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Co-authored-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2020-08-28 23:57:40 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "cluster-reset-restore-path",
|
|
|
|
Usage: "(db) Path to snapshot file to be restored",
|
|
|
|
Destination: &ServerConfig.ClusterResetRestorePath,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-12-12 22:41:10 +00:00
|
|
|
Name: "secrets-encryption",
|
|
|
|
Usage: "(experimental) Enable Secret encryption at rest",
|
|
|
|
Destination: &ServerConfig.EncryptSecrets,
|
|
|
|
},
|
2020-08-11 23:17:32 +00:00
|
|
|
&SELinuxFlag,
|
2019-10-27 05:53:25 +00:00
|
|
|
|
|
|
|
// Hidden/Deprecated flags below
|
|
|
|
|
2020-08-11 23:17:32 +00:00
|
|
|
&DisableSELinuxFlag,
|
2020-08-29 19:46:55 +00:00
|
|
|
FlannelFlag,
|
|
|
|
cli.StringSliceFlag{
|
2020-01-29 23:40:49 +00:00
|
|
|
Name: "no-deploy",
|
2020-04-27 16:45:51 +00:00
|
|
|
Usage: "(deprecated) Do not deploy packaged components (valid items: " + DisableItems + ")",
|
2020-01-29 23:40:49 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "cluster-secret",
|
|
|
|
Usage: "(deprecated) use --token",
|
2019-11-14 19:42:42 +00:00
|
|
|
Destination: &ServerConfig.ClusterSecret,
|
2020-08-29 19:46:55 +00:00
|
|
|
EnvVar: version.ProgramUpper + "_CLUSTER_SECRET",
|
2019-10-27 05:53:25 +00:00
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.BoolFlag{
|
2019-10-27 05:53:25 +00:00
|
|
|
Name: "disable-agent",
|
|
|
|
Usage: "Do not run a local agent and register a local kubelet",
|
|
|
|
Hidden: true,
|
|
|
|
Destination: &ServerConfig.DisableAgent,
|
|
|
|
},
|
2020-08-29 19:46:55 +00:00
|
|
|
cli.StringSliceFlag{
|
|
|
|
Hidden: true,
|
|
|
|
Name: "kube-controller-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-controller-manager process",
|
|
|
|
Value: &ServerConfig.ExtraControllerArgs,
|
|
|
|
},
|
|
|
|
cli.StringSliceFlag{
|
|
|
|
Hidden: true,
|
|
|
|
Name: "kube-cloud-controller-arg",
|
|
|
|
Usage: "(flags) Customized flag for kube-cloud-controller-manager process",
|
|
|
|
Value: &ServerConfig.ExtraCloudControllerArgs,
|
2019-10-27 05:53:25 +00:00
|
|
|
},
|
2019-01-09 16:54:15 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|