Skip to content

Commit

Permalink
Add chart integration (#37)
Browse files Browse the repository at this point in the history
* Add chart integration

go mod tidy

use rancher rke2-runtime

* Update kubeproxy to 1.18.4

* Update k8s image and fix kubeapi
  • Loading branch information
galal-hussein authored Jun 22, 2020
1 parent 9c48ed2 commit 1773b8b
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 122 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ VOLUME /var/lib/rancher/k3s
# Dapper/Drone/CI environment
FROM build AS dapper
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_OUTPUT ./dist ./bin ./build
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_TARGET dapper
ENV DAPPER_RUN_ARGS "-v rke2-pkg:/go/pkg -v rke2-cache:/root/.cache/go-build"
Expand All @@ -28,8 +28,8 @@ WORKDIR /source
# This image includes any host level programs that we might need. All binaries
# must be placed in bin/ of the file image and subdirectories of bin/ will be flattened during installation.
# This means bin/foo/bar will become bin/bar when rke2 installs this to the host
FROM k8s.gcr.io/hyperkube:v1.18.2 AS k8s
FROM rancher/k3s:v1.18.2-rc2-k3s1 AS k3s
FROM ranchertest/kubernetes:v1.18.4 AS k8s
FROM rancher/k3s:v1.18.4-k3s1 AS k3s
FROM ubuntu:18.04 AS containerd

ENV CONTAINERD_VERION=1.3.4
Expand Down Expand Up @@ -57,3 +57,4 @@ COPY --from=containerd \
/usr/local/bin/ctr \
/usr/local/bin/containerd-shim-runc-v1 \
/bin/
COPY ./build/static/charts /charts
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROG=rke2
GOLANGCI_VERSION=v1.25.1
GOLANGCI_VERSION=v1.27.0
REPO ?= rancher
IMAGE=${REPO}/rke2-runtime
K3S_PKG=github.com/rancher/k3s
Expand Down Expand Up @@ -111,7 +111,7 @@ clean-cache: ## Clean up docker base caches used for
docker volume rm ${PROG}-cache ${PROG}-pkg

clean: ## Clean up workspace
rm -rf bin dist
rm -rf bin dist build

dev-shell: .dev-shell-build ## Launch a development shell to run test builds
docker run --rm --name ${PROG}-dev-shell --hostname ${PROG}-server -ti -e WORKSPACE=$$(pwd) -p 127.0.0.1:2345:2345 -v $${HOME}:$${HOME} -v ${PROG} -w $$(pwd) --privileged -v ${PROG}-pkg:/go/pkg -v ${PROG}-cache:/root/.cache/go-build ${PROG}-dev bash
Expand All @@ -126,16 +126,30 @@ dev-peer: .dev-shell-build ## Launch a server peer to run test buil
dev-peer-enter: ## Enter the peer shell on another terminal
docker exec -it ${PROG}-peer${PEER} bash

artifacts: build
artifacts: build download-charts
mkdir -p dist/artifacts
cp bin/${PROG} dist/artifacts/${RELEASE}

.ci: validate-ci artifacts

in-docker-%: .dapper ## Advanced: wraps any target in Docker environment, for example: in-docker-build-debug
mkdir -p bin/ dist/
mkdir -p ./bin/ ./dist/
./.dapper -f Dockerfile --target dapper make $*

CHARTS_DIR = build/static/charts
MANIFEST_DIR = manifests
CHARTS = canal:v3.13.3 coredns:1.10.101 kube-proxy:v1.18.4 metrics-server:2.11.100 nginx-ingress:1.36.300
download-charts:
mkdir -p $(CHARTS_DIR)
for chart in $(CHARTS); do \
chart_name=`echo "$${chart}" | cut -d ":" -f 1`;\
chart_version=`echo "$${chart}" | cut -d ":" -f 2`;\
curl -sfL https://dev-charts.rancher.io/$$chart_name/$$chart_name-$$chart_version.tgz -o ${CHARTS_DIR}/$$chart_name-$$chart_version.tgz;\
chart_content=`base64 -w 0 ${CHARTS_DIR}/$$chart_name-$$chart_version.tgz`;\
sed -e "s|%{CHART_CONTENT}%|$$chart_content|g" $(MANIFEST_DIR)/$$chart_name.yml > $(CHARTS_DIR)/$$chart_name-chart.yml;\
rm ${CHARTS_DIR}/$$chart_name-$$chart_version.tgz;\
done

./.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/v0.5.0/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
Expand Down
53 changes: 26 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,38 @@ replace (
github.com/prometheus/client_model => github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
github.com/prometheus/common => github.com/prometheus/common v0.0.0-20181126121408-4724e9255275
github.com/prometheus/procfs => github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a
github.com/rancher/k3s => github.com/ibuildthecloud/k3s-dev v0.1.0-rc6.0.20200508172341-d560cca31b9e
k8s.io/api => github.com/rancher/kubernetes/staging/src/k8s.io/api v1.18.2-k3s.1
k8s.io/apiextensions-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.18.2-k3s.1
k8s.io/apimachinery => github.com/rancher/kubernetes/staging/src/k8s.io/apimachinery v1.18.2-k3s.1
k8s.io/apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiserver v1.18.2-k3s.1
k8s.io/cli-runtime => github.com/rancher/kubernetes/staging/src/k8s.io/cli-runtime v1.18.2-k3s.1
k8s.io/client-go => github.com/rancher/kubernetes/staging/src/k8s.io/client-go v1.18.2-k3s.1
k8s.io/cloud-provider => github.com/rancher/kubernetes/staging/src/k8s.io/cloud-provider v1.18.2-k3s.1
k8s.io/cluster-bootstrap => github.com/rancher/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.18.2-k3s.1
k8s.io/code-generator => github.com/rancher/kubernetes/staging/src/k8s.io/code-generator v1.18.2-k3s.1
k8s.io/component-base => github.com/rancher/kubernetes/staging/src/k8s.io/component-base v1.18.2-k3s.1
k8s.io/cri-api => github.com/rancher/kubernetes/staging/src/k8s.io/cri-api v1.18.2-k3s.1
k8s.io/csi-translation-lib => github.com/rancher/kubernetes/staging/src/k8s.io/csi-translation-lib v1.18.2-k3s.1
k8s.io/kube-aggregator => github.com/rancher/kubernetes/staging/src/k8s.io/kube-aggregator v1.18.2-k3s.1
k8s.io/kube-controller-manager => github.com/rancher/kubernetes/staging/src/k8s.io/kube-controller-manager v1.18.2-k3s.1
k8s.io/kube-proxy => github.com/rancher/kubernetes/staging/src/k8s.io/kube-proxy v1.18.2-k3s.1
k8s.io/kube-scheduler => github.com/rancher/kubernetes/staging/src/k8s.io/kube-scheduler v1.18.2-k3s.1
k8s.io/kubectl => github.com/rancher/kubernetes/staging/src/k8s.io/kubectl v1.18.2-k3s.1
k8s.io/kubelet => github.com/rancher/kubernetes/staging/src/k8s.io/kubelet v1.18.2-k3s.1
k8s.io/kubernetes => github.com/rancher/kubernetes v1.18.2-k3s.1
k8s.io/legacy-cloud-providers => github.com/rancher/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.18.2-k3s.1
k8s.io/metrics => github.com/rancher/kubernetes/staging/src/k8s.io/metrics v1.18.2-k3s.1
k8s.io/node-api => github.com/rancher/kubernetes/staging/src/k8s.io/node-api v1.18.2-k3s.1
k8s.io/sample-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/sample-apiserver v1.18.2-k3s.1
k8s.io/sample-cli-plugin => github.com/rancher/kubernetes/staging/src/k8s.io/sample-cli-plugin v1.18.2-k3s.1
k8s.io/sample-controller => github.com/rancher/kubernetes/staging/src/k8s.io/sample-controller v1.18.2-k3s.1
k8s.io/api => github.com/rancher/kubernetes/staging/src/k8s.io/api v1.18.4-k3s1
k8s.io/apiextensions-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.18.4-k3s1
k8s.io/apimachinery => github.com/rancher/kubernetes/staging/src/k8s.io/apimachinery v1.18.4-k3s1
k8s.io/apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiserver v1.18.4-k3s1
k8s.io/cli-runtime => github.com/rancher/kubernetes/staging/src/k8s.io/cli-runtime v1.18.4-k3s1
k8s.io/client-go => github.com/rancher/kubernetes/staging/src/k8s.io/client-go v1.18.4-k3s1
k8s.io/cloud-provider => github.com/rancher/kubernetes/staging/src/k8s.io/cloud-provider v1.18.4-k3s1
k8s.io/cluster-bootstrap => github.com/rancher/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.18.4-k3s1
k8s.io/code-generator => github.com/rancher/kubernetes/staging/src/k8s.io/code-generator v1.18.4-k3s1
k8s.io/component-base => github.com/rancher/kubernetes/staging/src/k8s.io/component-base v1.18.4-k3s1
k8s.io/cri-api => github.com/rancher/kubernetes/staging/src/k8s.io/cri-api v1.18.4-k3s1
k8s.io/csi-translation-lib => github.com/rancher/kubernetes/staging/src/k8s.io/csi-translation-lib v1.18.4-k3s1
k8s.io/kube-aggregator => github.com/rancher/kubernetes/staging/src/k8s.io/kube-aggregator v1.18.4-k3s1
k8s.io/kube-controller-manager => github.com/rancher/kubernetes/staging/src/k8s.io/kube-controller-manager v1.18.4-k3s1
k8s.io/kube-proxy => github.com/rancher/kubernetes/staging/src/k8s.io/kube-proxy v1.18.4-k3s1
k8s.io/kube-scheduler => github.com/rancher/kubernetes/staging/src/k8s.io/kube-scheduler v1.18.4-k3s1
k8s.io/kubectl => github.com/rancher/kubernetes/staging/src/k8s.io/kubectl v1.18.4-k3s1
k8s.io/kubelet => github.com/rancher/kubernetes/staging/src/k8s.io/kubelet v1.18.4-k3s1
k8s.io/kubernetes => github.com/rancher/kubernetes v1.18.4-k3s1
k8s.io/legacy-cloud-providers => github.com/rancher/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.18.4-k3s1
k8s.io/metrics => github.com/rancher/kubernetes/staging/src/k8s.io/metrics v1.18.4-k3s1
k8s.io/node-api => github.com/rancher/kubernetes/staging/src/k8s.io/node-api v1.18.4-k3s1
k8s.io/sample-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/sample-apiserver v1.18.4-k3s1
k8s.io/sample-cli-plugin => github.com/rancher/kubernetes/staging/src/k8s.io/sample-cli-plugin v1.18.4-k3s1
k8s.io/sample-controller => github.com/rancher/kubernetes/staging/src/k8s.io/sample-controller v1.18.4-k3s1
mvdan.cc/unparam => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
)

require (
github.com/google/go-containerregistry v0.0.0-20200424115305-087a4bdef7c4
github.com/pkg/errors v0.9.1
github.com/rancher/k3s v0.0.0
github.com/rancher/k3s v1.18.3-0.20200622210601-f5ee757b86f8
github.com/rancher/wrangler v0.6.1
github.com/sirupsen/logrus v1.4.2
github.com/urfave/cli v1.22.2
Expand Down
Loading

0 comments on commit 1773b8b

Please sign in to comment.