How to resolve error in k3s installation :Job for k3s.service failed

Viewed 59

I am facing problem in installing K3s on Ubuntu instance and connecting mysql AWS RDS with the master node . I have made 1 master node and 3 worker node .When I try to execute the following commands below I get error. Please help me with this .I checked the inbound and outbound rules in security group which is attached to RDS and EC2 instance but it works fine . Please Help !!!!

Job for k3s.service failed because the control process exited with error code.
See "systemctl status k3s.service" and "journalctl -xe" for details.

INSTALLATION COMMANDS after making RDS mysql dataabse with db name k3s

export K3S_DATASTORE_ENDPOINT='mysql://k3s:<xxxdbpasswordxxx>@tcp(k3s-cluster-db.cz2c5bol8r6l.us-east-1.rds.amazonaws.com:3306)/k3s' 
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig=/home/ubuntu/.kube/config  --write-kubeconfig-mode=644" sh -

ERROR :

enter image description here

INBOUND RULES

enter image description here

OUTBOUND RULES enter image description here

systemctl status k3s.service enter image description here

journalctl -xe

enter image description here

1 Answers

Your command seems to have two issues:

INSTALL_K3S_EXEC=“—write-kubeconfig=/home/ubuntu/.kube/config  --write-kubeconfig-mode=644” 
  • using “ instead of " can be misinterpreted by the shell
  • an option like —write-kubeconfig should use -- (as in —-write-kubeconfig)

Since the error message is flag provided but not defined: --write-kube-config (and has --), it is possible the above is just a font/display issue.
In that case, check if this is an option order issue as described here.

Related