Commit Graph

176 Commits (7ecd5874d2eab1fb24dcfad23003f42da5be3620)

Author SHA1 Message Date
Brian Downs 866dc94cea
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 16:57:40 -07:00
Brian Downs fa2c1422b3 change name of variable
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2020-08-19 14:30:53 -07:00
Brian Downs a4b2953017 add setup hook capabilities for rke2
Signed-off-by: Brian Downs <brian.downs@gmail.com>
2020-08-19 13:42:45 -07:00
Brad Davidson 79c499f0e0 Fix handling of TLS configuration args
Also fixes an unrelated error formatting issue turned up while testing.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-08-18 16:44:10 -07:00
Brad Davidson 1eec7348a5 Call setproctitle to conceal node args in ps output
This is related to #2014.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-07-28 15:49:49 -07:00
Erik Wilson e1dc3451bc
Add config file support 2020-07-10 10:34:00 -07:00
Darren Shepherd 7e59c0801e Make program name a variable to be changed at compile time 2020-06-06 16:39:41 -07:00
Chuck Schweizer 19c34bd12d Update to set default CipherSuites
The default CipherSuites need to be set to disable the insecure TLS 1.2 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Cipher
2020-05-13 08:34:45 -05:00
Chuck Schweizer ca9c9c2e1e Adding support for TLS MinVersion and CipherSuites
This will watch for the following kube-apiserver-arg variables and apply
them to the k3s kube-apiserver https listener.

  --kube-apiserver-arg=tls-cipher-suites=XXXXXXX
  --kube-apiserver-arg=tls-min-version=XXXXXXX
2020-05-07 09:27:09 -05:00
Darren Shepherd cb4b34763e
Merge pull request #1759 from ibuildthecloud/background
Start kube-apiserver in the background
2020-05-06 21:50:48 -07:00
Darren Shepherd 072396f774 Start kube-apiserver in the background
In rke2 everything is a static pod so this causes a chicken and egg situation
in which we need the kubelet running before the kube-apiserver can be
launched.  By starting the apiserver in the background this allows us to
do this odd bootstrapping.
2020-05-06 21:17:23 -07:00
Darren Shepherd 2f5ee914f9 Add supervisor port
In k3s today the kubernetes API and the /v1-k3s API are combined into
one http server.  In rke2 we are running unmodified, non-embedded Kubernetes
and as such it is preferred to run k8s and the /v1-k3s API on different
ports.  The /v1-k3s API port is called the SupervisorPort in the code.

To support this separation of ports a new shim was added on the client in
then pkg/agent/proxy package that will launch two load balancers instead
of just one load balancer.  One load balancer for 6443 and the other
for 9345 (which is the supervisor port).
2020-05-05 15:54:51 -07:00
Darren Shepherd 341895c322 Don't write ccm.yaml if --disable-cloud-controller is set 2020-05-05 13:01:52 -07:00
Erik Wilson c941e1d0bb
Merge pull request #1695 from ibuildthecloud/kubeproxy
Add ability to disable kubeproxy
2020-05-04 20:26:22 -07:00
Darren Shepherd 5715e1ba0d Add ability to disable kubeproxy 2020-04-27 11:24:00 -07:00
Darren Shepherd 8b8af94eb2 Move disabled items to a const to keep more consistency
This also help when embedding k3s because we can programmitically know
all the components to disable.
2020-04-27 11:15:35 -07:00
Erik Wilson 0374c4f63d Add --disable flag 2020-01-30 16:45:01 -07:00
Erik Wilson 1a2690d7be
Merge pull request #1192 from galal-hussein/add_encryption_config
Add secret encryption config
2020-01-27 13:59:09 -07:00
galal-hussein 388cd9c4e8 Add secret encryption configuration 2019-12-23 13:16:27 +02:00
Erik Wilson 76281bf731 Update k3s for k8s 1.17.0 2019-12-15 23:28:19 -07:00
galal-hussein 99b8222e8d Change storage to datastore 2019-11-15 21:52:07 -07:00
Erik Wilson 95ff805c98 Fix broken K3S_TOKEN env 2019-11-14 12:42:42 -07:00
Erik Wilson 47a94637dc Move metrics-server manifests to sub-directory 2019-11-05 14:30:50 -07:00
Darren Shepherd ba240d0611 Refactor tokens, bootstrap, and cli args 2019-10-30 19:06:49 -07:00
YAMAMOTO Takashi 4970d6133f Propagate DisableAgent flag
The recent setMasterRoleLabel stuff uses it.
2019-10-28 14:43:53 +09:00
Akihiro Suda aafccdbccb rootless: add kubelet flags automatically
Fix https://github.com/rancher/k3s/issues/784

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-25 17:10:14 +09:00
Erik Wilson da3a7c6bbc Add network policy controller 2019-10-18 16:11:42 -07:00
Erik Wilson 9e14d3e470
Merge pull request #851 from MagnaXSoftware/switch-string-slice
Add comma-separated no-deploy values
2019-10-16 16:00:46 -07:00
Xavier Landreville 2f4a08c54d Add comma-separated no-deploy values
This allows no-deploy values to be either specified as multiple --no-deploy invocations,
or a single invocation with comma-separated values.
2019-10-16 15:51:04 -04:00
galal-hussein d2c1f66496 Add k3s cloud provider 2019-10-16 21:13:15 +02:00
galal-hussein 56e0e5ad7e Add default local storage provisioner 2019-09-30 18:17:33 +02:00
Erik Wilson 959acf9c92 Add --flannel-backend flag 2019-09-27 18:26:39 -07:00
galal-hussein b1891f445b Add master role label on startup 2019-09-27 23:04:24 +02:00
Darren Shepherd 209acb58c1 Revert CSI patch 2019-08-31 22:39:24 -07:00
Erik Wilson 5679cfafaf
Merge pull request #707 from ibuildthecloud/pr683
Integrate Kine
2019-08-26 09:25:37 -07:00
Darren Shepherd 2cb6f52339 Disable storing bootstrap information by default 2019-08-24 22:27:24 -07:00
Erik Wilson e6067314c9 Localhost -> 127.0.0.1 2019-08-22 11:56:00 -07:00
galal-hussein 1ae0c540d7 Refactor bootstrap, move kine startup code to kine, integrate kine 2019-08-22 09:14:43 -07:00
Erik Wilson 30e050a692 Cleanup logging 2019-08-07 22:45:54 -07:00
Erik Wilson a17e336993 Use go tcpproxy 2019-07-30 09:53:15 -07:00
Erik Wilson e1162c7cfa Update agent to notify systemd 2019-07-18 06:40:39 -07:00
Erik Wilson 131f3bec44
Merge pull request #619 from erikwilson/node-ip-from-flannel-iface
Default node-ip from flannel-iface
2019-07-12 16:21:05 -07:00
Erik Wilson a1ce08d4f1 Default node-ip from flannel-iface 2019-07-12 15:46:36 -07:00
Darren Shepherd dbb7b04c3d Add option to disable scheduler 2019-07-12 09:59:03 -07:00
Erik Wilson 24b73403c7 Cleanup bootstrap 2019-06-30 12:39:54 -07:00
galal-hussein 37582b6fac Add cert storage backend flag 2019-06-28 20:47:21 +02:00
galal-hussein 28d9d83be2 Add k3s HA bootstrap 2019-06-27 21:00:43 +02:00
Erik Wilson 2c9444399b Refactor certs 2019-06-25 15:04:04 -07:00
galal-hussein 17d8708ca5 Add storage backend flags 2019-06-12 00:48:47 +02:00
Erik Wilson 199f673676
Merge pull request #479 from galal-hussein/add_storage_backend_options
Add MySQL and Postgress support
2019-05-28 16:57:38 -07:00
Darren Shepherd c0702b0492 Port to wrangler 2019-05-26 22:28:50 -07:00
Darren Shepherd 4b4dd1b59b
Merge pull request #454 from galal-hussein/node_labels_taints
Expose node labels and taints and add node roles
2019-05-25 00:39:55 +02:00
galal-hussein e9cd8adbf6 Add Storage endpoint option 2019-05-16 01:05:24 +02:00
galal-hussein 483df6fd82 Check if server time before 1/1/1980
Check
2019-05-10 20:29:42 +02:00
galal-hussein 930093dfe9 Expose node labels and taints and add node roles 2019-05-08 01:47:07 +02:00
galal-hussein fae6df0df0 Change the stderr threshold for cli 2019-05-01 05:23:32 +02:00
Marco Mancini b445bad171 Add --cluster-domain option 2019-04-12 08:06:35 +02:00
Darren Shepherd 046a817818 Add rootless support 2019-04-09 10:38:04 -07:00
galal-hussein 7794528aa1 Add extra flags for server and agent components 2019-04-09 08:20:38 +02:00
Darren Shepherd 841f8d29e6 Ensure CSI is initialized properly when running agent and server combined 2019-04-08 22:50:59 -07:00
galal-hussein d255574150 Add bind address server config 2019-03-31 02:10:23 +02:00
Takeaki Matsumoto 3a6b305455 Change flag name and type 2019-03-23 17:34:55 +00:00
Takeaki Matsumoto 9551e1db21 Add advertise-address flag
In NAT or LB environment,
we need not just the certs for local ip, but also additional ips.
advertise-address flag enables to add optional ips.
2019-03-18 08:26:23 +00:00
Darren Shepherd 9a862610ac
Merge pull request #177 from erikwilson/systemd-notify
Enable systemd ready notification for k3s server
2019-03-07 13:04:34 -07:00
Erik Wilson 107b5f3985 Enable systemd ready notification for k3s server
Disables k8s generic api server systemd ready notification and send
our own ready notification after server available and kubeconfig
available.

Make sure we unset the NOTIFY_SOCKET environment variable by passing
`true` to SdNotify so the agent can start containers.
2019-03-07 09:54:04 -07:00
Vladimir Zorin 44cce9a76f Set ClusterDNS to ServiceCIDR network address + 10 when cluster-dns is not provided 2019-03-06 20:41:07 +02:00
Vladimir Zorin 7ad03ad8b0 Add cluster-dns server arg support 2019-03-06 13:16:04 +02:00
Vladimir Zorin b8c3ff1dab Add --service-cidr server arg support 2019-03-06 12:37:03 +02:00
Darren Shepherd 0414f97c78 Revert "Enable systemd ready notification for k3s server"
This reverts commit c73e9187bb.
2019-03-04 13:18:20 -07:00
Darren Shepherd e5b7d36c55 Actually pass cluster-cidr on to server 2019-03-04 10:06:37 -07:00
Erik Wilson c73e9187bb Enable systemd ready notification for k3s server
Disables k8s generic api server systemd ready notification and send
our own ready notification after server available and kubeconfig
available.
2019-03-01 10:47:34 -07:00
Darren Shepherd 529aa431d1 Adjust debug logging and write containerd logs to a file 2019-02-07 21:45:31 -07:00
Darren Shepherd e832588662 Add embedded service load balancer 2019-02-04 16:47:53 -07:00
Darren Shepherd 400225e73d Prepopulate known IPs in TLS 2019-02-04 16:47:53 -07:00
Darren Shepherd 287e0f44c9 Prepare for initial release 2019-01-22 14:20:29 -07:00
Darren Shepherd 62c62cc7b4 Continued refactoring 2019-01-11 21:52:30 -07:00