neco is an interactive tool for administrators.
Features include:
- Bootstrap etcd and vault clusters.
- Edit etcd database to configure
neco-updaterandneco-worker. - Initialize application data before installation.
-
neco config set KEY VALUEChange the setting for
KEYtoVALUE. Key and values are described in another section.Some special keys read their values from environment variables due to security concerns. In these cases, do not give
VALUEin command line. -
neco config get KEYShow the current configuration for
KEY.
-
neco setup [--no-revoke] [--proxy=PROXY] LRN [LRN ...]Install and setup etcd cluster as well as Vault using given boot servers.
LRNis the logical rack number of the boot server. At least 3 LRNs should be specified.This command need to be invoked at once on all boot servers specified by LRN.
When
--no-revokeoption is specified, it does not revoke the initial root token. This is only for testing purpose.When
--proxyoption is specified, it uses this proxy to download container images. It also storesproxyconfiguration in the etcd database after it starts etcd, in order to run neco-updater and neco-worker with a proxy from the start. DO NOT passhttp_proxyandhttps_proxyenvironment variables toneco. -
neco init NAMEInitialize data for a new application. For example, this creates etcd user/role or Vault CA for the new application.
This command should be executed only once in the cluster.
-
neco init-local NAMEPrepare files to start
NAME. For example, this issues a client certificate for etcd authentication. This will ask users to input Vault username and password to issue certificates.This command should be executed on all boot servers.
-
neco init-dataInitialize data for sabakan and CKE. If uploaded versions are up to date, do nothing. This command must be invoked only once in the cluster after
neco initandneco init-localcompleted. -
neco statusShow the status of the current update process.
-
neco join LRN [LRN ...]Prepare certificates and files to add this server to the cluster.
LRNare a list of LRNs of the existing boot servers.To issue certificates, this command asks the user Vault username and password. If
VAULT_TOKENenvironment variable is not empty, it is used instead.This command also creates
/etc/neco/config.yml.Etcd and Vault themselves are not installed by this command. They are installed later by
neco-worker. Similarly, this command does not add the new server to etcd cluster.neco-workerwill add the server to etcd cluster. -
neco leave LRNUnregister
LRNof the boot server from etcd. -
neco recoverRemoves the current update status from etcd to resolve the update failure.
-
neco is-running IMAGECheck if the given
IMAGEis running as a container on the boot server. If it is running, this exits with status 0. Otherwise, with status 1.
-
neco ssh generate [--dump]Generates a new SSH key pair for sabakan controlled machines.
The generated public key is stored in etcd and will be automatically set for users defined in ignition templates.
The generated private key is stored in Vault by using
ckecli vault ssh-privkey.When
--dumpoption is specified, the generated private key is also dumped to stdout.
-
neco vault unsealUnseal the local vault server using the initial unseal key stored in etcd.
-
neco vault show-unseal-keyShow the initial vault unseal key if not removed.
-
neco vault remove-unseal-keyRemove the initial vault unseal key from etcd.
-
neco vault show-root-tokenShow the initial root token, if not revoked during
neco setup.
-
neco bmc config set KEY VALUEChange the setting for
KEYtoVALUE. Keys and values are described below.bmc-user: Registerbmc-user.jsonipmi-user: Register IPMI username for power management.ipmi-password: Register IPMI password for power management.repair-user: Register BMC username for repair operations.repair-password: Register BMC password for repair operations.
-
neco bmc config get KEYGet the
VALUEforKEY. -
neco bmc repair BMC_TYPE BMC_specific_command...Try to repair an unhealthy/unreachable machine by invoking BMC functions remotely.
- Dell iDRAC:
neco bmc repair dell reset-idrac SERIAL_OR_IPReset the iDRAC of a machine havingSERIALorIPaddress.neco bmc repair dell discharge SERIAL_OR_IPSimulate power-disconnection and discharge of a machine havingSERIALorIPaddress. This implies reboot of the machine.
- Dell iDRAC:
-
neco bmc setup-hwInvoke
setup-hwcommand in setup-hw container. If needed, reboot the machine. -
neco power [start|stop|restart|status] [--wait-for-stop] SERIAL_OR_IPControl power of a machine having
SERIALorIPaddress. It just request BMC to control power, not wait for its completion.When
--wait-for-stopoption is specified forstoporrestartaction, it wait until the machine stops. -
neco reboot-and-wait SERIAL_OR_IPReboot a machine having
SERIALorIPaddress, and wait for its boot-up. -
neco reboot-check SERIAL_OR_IP UNIXTIMECheck (re)boot-up of a machine having
SERIALorIPaddress after theUNIXTIME. If rebooted, printstrue. If not rebooted, printsfalse. -
neco reboot-workerReboot all or specified worker nodes.
This uses CKE's function of graceful reboot for the nodes used by CKE. As for the other nodes, this reboots them immediately. If some nodes are already powered off, this command does not do anything to those nodes.
sabactl machines get-like options can be used to narrow down the machines to be rebooted.
The name of the cluster in cke-template.yml will be overwritten with the value read from /etc/neco/cluster.
The weight is values of each role for overriding labels["cke.cybozu.com/weight"] values in cke-template.yml.
When commands as follows run ckecli sabakan set-template internally, read etcd saved weight values and then generate cke-template.yml.
neco-workerneco init-dataneco cke update
See details Role and weights.
-
neco cke weight listList current weight of roles.
-
neco cke weight get ROLEGet current weight of given role.
-
neco cke weight set ROLE WEIGHTSet given weight to the role.
-
neco cke updateUpdate cke template using overriding weights. This is useful if administrator updates role and weights in the running Kubernetes cluster.
neco tpm clear SERIAL_OR_IP
Clear TPM devices on a machine having SERIAL or IP address.
The command fails when the target machine's status is not retiring.
--force option is explicitly required.
neco tpm show SERIAL_OR_IP
Show TPM devices on a machine having SERIAL or IP address.
neco isoreboot ISO_FILE
Connect iso file to Virtual DVD and schedule reboot.
sabactl machines get-like options can be used to narrow down the machines to be updated.
neco apply-firmware UPDATER_FILE...
Send firmware updaters to BMC and schedule reboot.
sabactl machines get-like options can be used to narrow down the machines to be updated.
neco session-log start
Start session logging by script(1). After invoked shell exits, session log is put to the object bucket located at http://s3gw.session-log.svc .
-
neco image NAMEShow docker image URL of
NAME(e.g. "etcd", "coil", "squid"). -
neco teleport configGenerate config for teleport by filling template with secret in file and dynamic info in etcd.
-
neco completionDump bash completion rules for
necocommand.
These configurations are stored in etcd database.
Specify the cluster environment.
Possible values are: staging and prod.
staging environment will be updated with pre-releases of neco package.
Update never happens until this config is set.
Specify Slack WebHook URL.
neco-updater will post notifications to this.
Specify HTTP proxy server to access Internet.
It will be used by neco-updater and neco-worker.
Specify polling interval for checking new neco package release.
The value will be parsed by time.ParseDuration.
The default value is 10m.
Specify timeout value to wait for workers during update process.
The value will be parsed by time.ParseDuration.
The default value is 60m.
Set GitHub personal access token for using GitHub API with authenticated user.
It will be used by neco-updater and neco-worker.
Specify HTTP proxy server to access Internet for worker nodes. This value is used as metadata in the ignition template.
Specify an IP address block assigned to Nodes by a LoadBalancer controller. This value is used as metadata in the ignition template.
- Run
neco setup 0 1 2on each boot server.- Install etcd and vault.
- Start
vaultservice temporarily to prepare CA and initial certificates - Start TLS-enabled cluster.
- Restart
vaultas a real service, import CA to thevault. - Reissue certificates for etcd and vault.
- Restart etcd and vault with new certificates.
- Save root token to the etcd key
<prefix>/vault-root-token. - Save new client certificates as
/etc/neco/etcd.crtand/etc/neco/etcd.key - Create
/etc/neco/neco-updater.ymland/etc/nec/neco-worker.yml. - Create an etcd key
<prefix>/vault-unseal-key. - Remove an etcd key
<prefix>/vault-root-tokenby default. - Add etcd key
<prefix>/bootservers/LRNon the finished boot server.
- Run
neco init NAMEon one of boot servers. etcd user/role has created. - Run
neco init-local NAMEon each boot server. Client certificates forNAMEhave issued. - (Optional) Run
neco cke weighton one of boot servers for generatingcke-template.yml. - Run
neco init-dataon one of boot servers.
- Run
neco join 0 1 2on a new server.- Install etcd and vault.
- Access another vault server to issue client certificates for etcd and vault.
- Save client certificates as
/etc/neco/etcd.crtand/etc/neco/etcd.key - Create
/etc/neco/neco-updater.ymland/etc/neco/neco-worker.yml. - Add member to the etcd cluster.
- Add a new boot server to the etcd key
<prefix>/bootservers/LRN.
- Run
neco init-local NAMEon a new boot server. Client certificates forNAMEhave issued.
Existing boot servers need to maintain application configuration files to update the list of etcd endpoints.
When a new program is added to artifacts.go, it should be setup as follows:
neco-workerinstalls the program but does not start it yet.- Run
neco init NAMEon a boot server. - Run
neco init-local NAMEon all boot servers.
- Run
neco leave LRNon the current running boot server.- Remove etcd key
<prefix>/bootservers/LRN.
- Remove etcd key
Existing boot servers need to maintain application configuration files to update the list of etcd endpoints.