Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Created March 5, 2019 17:34
Show Gist options
  • Save azyobuzin/4183406000a2c608d0b00f0401ff663b to your computer and use it in GitHub Desktop.
Save azyobuzin/4183406000a2c608d0b00f0401ff663b to your computer and use it in GitHub Desktop.
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
After=network.target k3s-env.service
Requires=k3s-env.service
[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
Environment="K3S_TOKEN=とーくん"
EnvironmentFile=/run/k3senv
ExecStart=/usr/local/bin/k3s agent
KillMode=process
Delegate=yes
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
[Unit]
Description=Create /run/k3senv
After=local-fs.target network.target nss-lookup.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo \"K3S_URL=https://$(getent hosts k8stest.local | cut -d ' ' -f 1):6443\" > /run/k3senv"
RemainAfterExit=yes
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
After=network.target
[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server
KillMode=process
Delegate=yes
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment