Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: keel-hq/keel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.4.3
Choose a base ref
...
head repository: keel-hq/keel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 9,529 changed files with 75,065 additions and 4,827,603 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 0 additions & 20 deletions .circleci/config.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

version: 1
update_configs:
- package_manager: "javascript"
directory: "/ui"
update_schedule: "daily"
- package_manager: "go:modules"
directory: "/"
update_schedule: "daily"
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/.git
envsettings.ps1
envsettings.ps1.template
helpers.ps1
LICENSE
compose*
build.ps1
azure-pipelines.yml
.gitignore
.drone.yml
readme.md
serviceaccount/*
chart/*
Dockerfile*
72 changes: 72 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
kind: pipeline
name: default

workspace:
base: /go
path: src/github.com/keel-hq/keel

steps:
- name: unit-test
image: golang:1.23.4
commands:
- make test

- name: build
image: golang:1.23.4
commands:
- make install

- name: build-ui
image: node:16.20.2-alpine
commands:
- cd ui
- yarn
- yarn run lint --no-fix

- name: publish-image
image: plugins/docker
settings:
repo: keelhq/keel
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password

# - name: build-arm
# image: golang:1.14.2
# commands:
# - make arm

# - name: publish-arm-image
# image: plugins/docker
# settings:
# repo: keelhq/keel-arm
# dockerfile: dockerfile.armhf
# auto_tag: true
# username:
# from_secret: docker_username
# password:
# from_secret: docker_password

# - name: publish-aarch64-image
# image: plugins/docker
# settings:
# repo: keelhq/keel-aarch64
# dockerfile: dockerfile.aarch64
# auto_tag: true
# username:
# from_secret: docker_username
# password:
# from_secret: docker_password

- name: slack
image: plugins/slack
when:
status: [ success, failure ]
settings:
webhook:
from_secret: slack_url
channel: general
username: drone
icon_url: https://i.pinimg.com/originals/51/29/a4/5129a48ddad9e8408d2757dd10eb836f.jpg
37 changes: 37 additions & 0 deletions .github/workflows/releasecharts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release Charts
on:
push:
tags:
- "chart-*"
jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4.2.0
- name: Extract tag version
id: get_version
run: echo "version=${GITHUB_REF##*/chart-}" >> $GITHUB_ENV
- name: Update Chart.yaml version
run: |
sed -i "s/^version:.*/version: ${GITHUB_ENV_VERSION}/" chart/keel/Chart.yaml
env:
GITHUB_ENV_VERSION: ${{ env.version }}
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: chart
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.kubeconfig
deployment.yml
.test_env.sh
cmd/keel/release
cmd/keel/keel
hack/deployment-norbac.yaml
hack/deployment-rbac.yaml
hack/deployment-norbac-helm.yaml
.vscode
.idea/
tests.out
envsettings.ps1
serviceaccount/*
cmd/keel/keel.exe
test_results.xml
22 changes: 22 additions & 0 deletions .pipeline/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
steps:

# Generate Helm packages
- name: 'ubuntu'
args: ['bash', './.scripts/gen_packages.sh']
id: 'gen_packages'

# Fetch charts and index.yaml from GCS bucket
- name: 'gcr.io/cloud-builders/gsutil'
args: ['rsync', 'gs://charts.keel.sh', 'temp/']
id: 'fetch_charts_index'

# Index repository
- name: 'ubuntu'
env:
- 'REPO_URL=https://charts.keel.sh'
args: ['bash', './.scripts/index_repo.sh']

# Upload charts to GCS bucket
- name: gcr.io/cloud-builders/gsutil
args: ['rsync', 'temp/', 'gs://charts.keel.sh']
id: 'upload_charts'
25 changes: 25 additions & 0 deletions .scripts/gen_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
set -e

echo "Installing curl"
apt update
apt install curl -y

echo "Installing helm"
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c

echo "Packaging charts from source code"
mkdir -p temp
for d in chart/*
do
# shellcheck disable=SC3010
if [[ -d $d ]]
then
# Will generate a helm package per chart in a folder
echo "$d"
helm package "$d"
# shellcheck disable=SC2035
mv *.tgz temp/
fi
done
17 changes: 17 additions & 0 deletions .scripts/index_repo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -e

echo "Installing curl"
apt update
apt install curl -y

echo "Installing helm"
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c

echo "Indexing repository"
if [ -f index.yaml ]; then
helm repo index --url "${REPO_URL}" --merge index.yaml ./temp
else
helm repo index --url "${REPO_URL}" ./temp
fi
47 changes: 47 additions & 0 deletions .scripts/repo-sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
set -e

# the repo path to this repository
REPO_URL="https://charts.keel.sh"

function gen_packages() {
echo "Packaging charts from source code"
mkdir -p temp
for d in chart/*
do
if [[ -d $d ]]
then
# Will generate a helm package per chart in a folder
echo "$d"
helm package "$d"
# shellcheck disable=SC2035
mv *.tgz temp/
fi
done
}

function index() {
echo "Fetch charts and index.yaml"
gsutil rsync gs://charts.keel.sh ./temp/

echo "Indexing repository"
if [ -f index.yaml ]; then
helm repo index --url ${REPO_URL} --merge index.yaml ./temp
else
helm repo index --url ${REPO_URL} ./temp
fi
}

function upload() {
echo "Upload charts to GCS bucket"
gsutil rsync ./temp/ gs://charts.keel.sh
}

# generate helm chart packages
gen_packages

# create index
index

# upload to GCS bucket
upload
7 changes: 7 additions & 0 deletions .test/ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
remote: k8s
target-branch: master
chart-dirs:
- chart
excluded-charts:
- common
helm-extra-args: --timeout 800s
68 changes: 68 additions & 0 deletions .test/e2e-kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}"

run_kind() {

echo "Get kind binary..."
# docker run --rm -it -v "$(pwd)":/go/bin golang go get sigs.k8s.io/kind && chmod +x kind && sudo mv kind /usr/local/bin/
curl -Lo kind https://storage.googleapis.com/rimusz-ci-artifacts/kind && chmod +x kind && sudo mv kind /usr/local/bin/


echo "Download kubectl..."
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/"${K8S_VERSION}"/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
echo

echo "Create Kubernetes cluster with kind..."
kind create cluster --image=kindest/node:"$K8S_VERSION"

echo "Export kubeconfig..."
# shellcheck disable=SC2155
export KUBECONFIG="$(kind get kubeconfig-path)"
echo

echo "Ensure the apiserver is responding..."
kubectl cluster-info
echo

echo "Wait for Kubernetes to be up and ready..."
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
echo
}

main() {

echo "Starting kind ..."
echo
run_kind

local config_container_id
config_container_id=$(docker run -it -d -v "$REPO_ROOT:/workdir" --workdir /workdir "$CHART_TESTING_IMAGE:$CHART_TESTING_TAG" cat)

# shellcheck disable=SC2064
trap "docker rm -f $config_container_id > /dev/null" EXIT

# Get kind container IP
kind_container_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kind-1-control-plane)
# Copy kubeconfig file
docker exec "$config_container_id" mkdir /root/.kube
docker cp "$KUBECONFIG" "$config_container_id:/root/.kube/config"
# Update in kubeconfig localhost to kind container IP
docker exec "$config_container_id" sed -i "s/localhost/$kind_container_ip/g" /root/.kube/config

echo "Add git remote k8s ${CHARTS_REPO}"
git remote add k8s "${CHARTS_REPO}" &> /dev/null || true
git fetch k8s master
echo

# Run chart install test
docker exec "$config_container_id" ct install --config /workdir/.test/ct.yaml

echo "Done Testing!"
}

main
Loading