Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mback2k committed Jan 20, 2021
0 parents commit 72e064e
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/torcx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: make

- uses: actions/upload-artifact@v2
with:
name: 'torcx-addons'
path: 'torcx.*'

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build

runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: 'torcx-addons'

- id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: 'torcx.tgz'
asset_path: 'torcx.tgz'
asset_content_type: application/gzip

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: 'torcx.squashfs'
asset_path: 'torcx.squashfs'
asset_content_type: application/octet-stream
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build: torcx.tgz torcx.squashfs


kube-node.tar.gz:
wget -q https://dl.k8s.io/v1.20.2/kubernetes-node-linux-amd64.tar.gz -O kube-node.tar.gz

kube-node: kube-node.tar.gz
tar -xzf kube-node.tar.gz


torcx: kube-node
mkdir -p rootfs/bin
cp -ar kubernetes/node/bin/* rootfs/bin/

torcx.tgz: torcx
tar -C rootfs -czf torcx.tgz .

torcx.squashfs: torcx
mksquashfs rootfs torcx.squashfs
14 changes: 14 additions & 0 deletions rootfs/.torcx/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"kind": "image-manifest-v0",
"value": {
"bin": [
"/bin/kube-proxy",
"/bin/kubelet",
"/bin/kubectl"
],
"units": [
"/lib/systemd/system/kube-proxy.service",
"/lib/systemd/system/kubelet.service"
]
}
}
16 changes: 16 additions & 0 deletions rootfs/lib/systemd/system/kube-proxy.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Requires=torcx.target
After=torcx.target
Description=Kubernetes Kube-Proxy Server
After=network.target
Requires=network.target

[Service]
EnvironmentFile=/run/metadata/torcx
ExecStart=/usr/bin/env ${TORCX_BINDIR}/kube-proxy --config=/etc/kubernetes/kube-proxy.yaml
Restart=always
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
19 changes: 19 additions & 0 deletions rootfs/lib/systemd/system/kubelet.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Requires=torcx.target
After=torcx.target
Description=Kubernetes Kubelet Server
After=containerd.service
Requires=containerd.service

[Service]
EnvironmentFile=/run/metadata/torcx
ExecStart=/usr/bin/env ${TORCX_BINDIR}/kubelet --config=/etc/kubernetes/kubelet.yaml \
--container-runtime=remote \
--container-runtime-endpoint=unix:///run/docker/libcontainerd/docker-containerd.sock \
--kubeconfig=/etc/kubernetes/kubelet.kubeconfig
Restart=always
RestartSec=5
KillMode=process

[Install]
WantedBy=multi-user.target

0 comments on commit 72e064e

Please sign in to comment.