From 30451e2b5fd5090d610edcbfdfd28137a15bda07 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 2 Apr 2024 17:21:21 +0200 Subject: [PATCH] Init commit --- .woodpecker/build.yaml | 32 ++++++++++++++++++++++++++++++++ Containerfile | 3 +++ examples/cm.yaml | 9 +++++++++ examples/pod.yaml | 11 +++++++++++ hooks/down.sh | 15 +++++++++++++++ hooks/up.sh | 35 +++++++++++++++++++++++++++++++++++ tpls/hetzner-k8s.yaml | 28 ++++++++++++++++++++++++++++ 7 files changed, 133 insertions(+) create mode 100644 .woodpecker/build.yaml create mode 100644 Containerfile create mode 100644 examples/cm.yaml create mode 100644 examples/pod.yaml create mode 100644 hooks/down.sh create mode 100755 hooks/up.sh create mode 100644 tpls/hetzner-k8s.yaml diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..d0605ab --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,32 @@ +--- +when: + event: + - push + +steps: + build: + image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:152f5b777abda1b18e3b231c295e2574f0e1cbdb + name: Build shoebill operator image + privileged: true + environment: + - PACKAGE_NAME=softplayer/softplayer-backend + commands: + - git config --global --add safe.directory '*' + - | + if [[ "${CI_COMMIT_TAG}" ]]; then + export CUSTOM_TAG="${CI_COMMIT_TAG}"; + fi + - build-container + secrets: + - gitea_token + backend_options: + kubernetes: + resources: + requests: + memory: 500Mi + cpu: 200m + limits: + memory: 1000Mi + cpu: 1000m + securityContext: + privileged: true diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..04e9e0a --- /dev/null +++ b/Containerfile @@ -0,0 +1,3 @@ +FROM ghcr.io/flant/shell-operator:latest +ADD /hooks /hooks +ADD /tpls /tpls diff --git a/examples/cm.yaml b/examples/cm.yaml new file mode 100644 index 0000000..1e6473a --- /dev/null +++ b/examples/cm.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: test + labels: + component: bootstrap +data: + provider: hetzner + cluster: k3s diff --git a/examples/pod.yaml b/examples/pod.yaml new file mode 100644 index 0000000..bff4c68 --- /dev/null +++ b/examples/pod.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Pod +metadata: + name: shell-operator +spec: + containers: + - name: shell-operator + image: so + imagePullPolicy: Never + serviceAccountName: monitor-pods-cm + diff --git a/hooks/down.sh b/hooks/down.sh new file mode 100644 index 0000000..24f7070 --- /dev/null +++ b/hooks/down.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +if [[ $1 == "--config" ]] ; then + cat <