Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持离线kubez-ansible的镜像部署模式 #38

Merged
merged 4 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Build kubez-ansible-offline image

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login in dockerhub
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
username: jacky06
password: jacky06jacky06

- name: Build and push kubez-ansible image
run: make push
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: run build image push clean

tag = v2.0.1-offline
releaseName = kubez-ansible
dockerhubUser = jacky06

ALL: run

image:
docker build --no-cache -t $(dockerhubUser)/$(releaseName):$(tag) -f docker/Dockerfile .

push: image
docker push $(dockerhubUser)/$(releaseName):$(tag)
17 changes: 15 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
FROM alpine:latest
RUN apk add --update curl iperf3 bind-tools busybox-extras && rm -rf /var/cache/apk/*
FROM ubuntu:18.04

WORKDIR /kubez-ansible
COPY . .

RUN apt-get update
RUN apt install -y git python-pip ansible sshpass && \
pip install /kubez-ansible && \
apt remove -y git python-pip && \
apt autoremove -y && \
apt-get clean

COPY docker/start.sh /usr/local/bin/pixiu_start

CMD ["pixiu_start"]
13 changes: 13 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -o errexit
set -o xtrace

if [[ ! -d "/etc/kubez" ]]; then
mkdir -p /etc/kubez
fi

cp /configs/globals.yml /etc/kubez/globals.yml
cp /configs/multinode /etc/kubez/multinode
cp /configs/hosts /etc/hosts

kubez-ansible -i /etc/kubez/multinode ${COMMAND}
Loading