diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..812f035 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,36 @@ +name: Build and Push Docker Image to GHCR + +on: + push: + branches: + - main + paths: + - '.github/workflows/docker-build.yml' + - 'docker/**' + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ghcr.io/tithia/basic:latest + ghcr.io/tithia/basic:${{ github.run_number }} diff --git a/README.md b/README.md index 42a666c..be15ec9 100755 --- a/README.md +++ b/README.md @@ -57,6 +57,14 @@ Below command uses the `--user` argument in order to define with which user will ansible-playbook -i ./infra/spark_inventory.ini --user tithia ./infra/spark.yml ``` +## Docker + +A specialized container image has been prepared in order to be used by JupyterHub. The relevant content is under the `docker` directory. + +``` +docker login -u angelosnm -p ghcr.io +``` + ## Kubernetes (K3s) #### Download and install the K3s Kubernetes distribution (a lightweight Kubernetes installer for single-node or cluster setups). @@ -105,6 +113,14 @@ sudo cat /var/lib/rancher/k3s/server/node-token curl -sfL https://get.k3s.io | K3S_URL=https://:6443 K3S_TOKEN= sh - ``` +#### Taint control plane node to prevent pods scheduling +``` +kubectl taint nodes tithia-kube-control-plane node-role.kubernetes.io/control-plane:NoSchedule +``` + + + + ### Metrics-server ``` kubectl apply -f ./kube/metrics-server/metrics-server.yaml