movd / k0s-ansible Goto Github PK
View Code? Open in Web Editor NEWCreate a Kubernetes Cluster using Ansible and the vanilla upstream Kubernetes distro k0s.
License: Apache License 2.0
Create a Kubernetes Cluster using Ansible and the vanilla upstream Kubernetes distro k0s.
License: Apache License 2.0
k0s now supports a full featured templating mechanism to write the systemd service file. Recommend adoption of up stream native systemd service file creation strategy.
root@k0s:~# k0s install --help
Helper command for setting up k0s on a brand-new system. Must be run as root (or with sudo)
Usage:
k0s install [flags]
Flags:
-h, --help help for install
--role string node role (possible values: server or worker. In a single-node setup, a worker role should be used) (default "server")
Global Flags:
-c, --config string config file (default: ./k0s.yaml)
--data-dir string Data Directory for k0s (default: /var/lib/k0s). DO NOT CHANGE for an existing setup, things will break!
-d, --debug Debug logging (default: false)
-l, --logging stringToString Logging Levels for the different components
Recommended: resolve deltas between k0s systemd service file and k0s systemd service file for consistency & experience integrity.
Compare:
A) movd/k0s-ansible systemd template: roles/k0s/initial_controller/templates/k0s.service.j2
B) k0sproject/k0s systemd example: init/k0s.service
Hi,
the role k0s/initial_controller utilizes the command:
k0s token create --role controller --config {{ k0s_config_dir }}/k0s.yaml
It looks like the flag --config is not valid anymore:
$ k0s token create --role worker --config /etc/k0s/k0s.yaml
Error: unknown flag: --config
Tested with: v1.26.0+k0s.0
The flag is not available in the latest documentation:
https://docs.k0sproject.io/v1.26.2+k0s.1/cli/k0s_token_create/
Update:
Same for role k0s/worker
k0s install worker --config {{ k0s_config_dir }}/k0s.yaml --token-file {{ k0s_config_dir }}/worker-token {{ extra_args | default(omit) }}
--config flag was removed: https://docs.k0sproject.io/v1.26.2+k0s.1/cli/k0s_install_worker/
Hi team,
I am following this document < https://docs.k0sproject.io/v1.23.6+k0s.2/examples/ansible-playbook/ > to create k0s cluster using ansible, on the Linux/AMD64 AWS bare metal instance.
It seems like the k0s cluster got created successfully and all the worker nodes are in ready state:
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k0s-4 Ready <none> 10m v1.22.4+k0s 10.197.110.121 <none> Ubuntu 22.04.1 LTS 5.15.0-53-generic containerd://1.5.8
k0s-5 Ready <none> 10m v1.22.4+k0s 10.197.110.251 <none> Ubuntu 22.04.1 LTS 5.15.0-53-generic containerd://1.5.8
k0s-6 Ready <none> 10m v1.22.4+k0s 10.197.110.142 <none> Ubuntu 22.04.1 LTS 5.15.0-53-generic containerd://1.5.8
k0s-7 Ready <none> 10m v1.22.4+k0s 10.197.110.104 <none> Ubuntu 22.04.1 LTS 5.15.0-53-generic containerd://1.5.8
Then I created nginx deployment with 5 replicas and that seems to work as well:
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 5/5 5 5 64s
I exposed nginx port 80 to 8100 as mentioned in the docs:
$ kubectl expose deployment nginx --target-port=80 --port=8100
service/nginx exposed
But I get no response from nginx deployment when I wget it from busybox.
$ kubectl run hello-k0s --image=quay.io/prometheus/busybox --rm -it --restart=Never --command -- wget -qO- nginx:8100
pod "hello-k0s" deleted
Error from server: Get "https://10.197.110.121:10250/containerLogs/default/hello-k0s/hello-k0s": dial timeout, backstop
I even mentioned port 80 (--port=80) while creating nginx deployment using kubectl, but that didn’t help.
Instead of busybox, I tried using ubuntu image, but the results are the same.
Can you please provide me with some pointers here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.