Skip to content

Commit

Permalink
Move helm chart to installer repo (#564)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Jul 8, 2023
1 parent ca92b32 commit 90e4df7
Show file tree
Hide file tree
Showing 20 changed files with 10 additions and 707 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:

- name: Prepare Host
run: |
sudo apt-get -qq update || true
sudo apt-get install -y bzr
# install yq
curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
chmod +x yq
Expand Down Expand Up @@ -83,11 +81,16 @@ jobs:
needs: build
strategy:
matrix:
k8s: [v1.19.16, v1.20.15, v1.21.14, v1.22.17, v1.23.17, v1.24.12, v1.25.8, v1.26.3, v1.27.1]
k8s: [v1.19.16, v1.27.1]

steps:
- uses: actions/checkout@v1

- name: Check out installer
run: |
cd ..
git clone https://github.com/kubeops/installer.git
- name: Create Kubernetes ${{ matrix.k8s }} cluster
id: kind
uses: engineerd/setup-kind@v0.5.0
Expand All @@ -98,10 +101,6 @@ jobs:

- name: Prepare cluster for testing
id: local-path
env:
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
USERNAME: 1gtm
REGISTRY_SECRET: regcred
run: |
echo "waiting for nodes to be ready ..."
kubectl wait --for=condition=Ready nodes --all --timeout=5m
Expand All @@ -111,15 +110,6 @@ jobs:
echo
echo "install helm 3"
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
echo
echo "create docker-registry secret"
kubectl create ns kubeops
kubectl create secret docker-registry ${REGISTRY_SECRET} --namespace=kubeops --docker-server=https://index.docker.io/v1/ --docker-username=${USERNAME} --docker-password=${DOCKER_TOKEN}
- name: Test charts
run: |
export KUBECONFIG="${HOME}/.kube/config"
make ct
- name: Run e2e tests
env:
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,3 @@ jobs:
run: |
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
make release
- name: Publish to Docker Registry
env:
SRC_REG: ghcr.io/appscode
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
USERNAME: 1gtm
APPSCODE_ENV: prod
run: |
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
make release
helm:
name: Helm
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v1

- name: Install GitHub CLI
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
- name: Install Helm 3
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- name: Clone charts repository
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
run: |
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${CHART_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
git clone $url
cd $(basename $CHART_REPOSITORY)
git config user.name "${GITHUB_USER}"
git config user.email "${GITHUB_USER}@appscode.com"
- name: Package
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
run: |
cd $RUNNER_WORKSPACE/$(basename $CHART_REPOSITORY)
./hack/scripts/open-pr.sh $GITHUB_WORKSPACE
1 change: 0 additions & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ LABEL org.opencontainers.image.source https://github.com/kubeops/config-syncer

ADD bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

# USER 65534
USER 65534

ENTRYPOINT ["/{ARG_BIN}"]
41 changes: 4 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,9 @@ version:
@echo ::set-output name=commit_hash::$(commit_hash)
@echo ::set-output name=commit_timestamp::$(commit_timestamp)

.PHONY: gen-chart-doc
gen-chart-doc: gen-chart-doc-config-syncer

gen-chart-doc-%:
@echo "Generate $* chart docs"
@docker run --rm \
-u $$(id -u):$$(id -g) \
-v /tmp:/.cache \
-v $$(pwd):$(DOCKER_REPO_ROOT) \
-w $(DOCKER_REPO_ROOT) \
--env HTTP_PROXY=$(HTTP_PROXY) \
--env HTTPS_PROXY=$(HTTPS_PROXY) \
$(BUILD_IMAGE) \
chart-doc-gen -d ./charts/$*/doc.yaml -v ./charts/$*/values.yaml > ./charts/$*/README.md

.PHONY: gen
gen: gen-chart-doc
gen:
@true

fmt: $(BUILD_DIRS)
@docker run \
Expand Down Expand Up @@ -334,26 +320,6 @@ e2e-tests: $(BUILD_DIRS)
e2e-parallel:
@$(MAKE) e2e-tests GINKGO_ARGS="-p -stream --flakeAttempts=2" --no-print-directory

.PHONY: ct
ct: $(BUILD_DIRS)
@docker run \
-i \
--rm \
-v $$(pwd):/src \
-w /src \
--net=host \
-v $(HOME)/.kube:/.kube \
-v $(HOME)/.minikube:$(HOME)/.minikube \
-v $(HOME)/.credentials:$(HOME)/.credentials \
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \
-v $$(pwd)/.go/cache:/.cache \
--env HTTP_PROXY=$(HTTP_PROXY) \
--env HTTPS_PROXY=$(HTTPS_PROXY) \
--env KUBECONFIG=$(subst $(HOME),,$(KUBECONFIG)) \
$(CHART_TEST_IMAGE) \
ct lint-and-install --all

ADDTL_LINTERS := goconst,gofmt,goimports,unparam

.PHONY: lint
Expand Down Expand Up @@ -389,7 +355,8 @@ endif

.PHONY: install
install:
@kubectl create ns $(KUBE_NAMESPACE) || true; \
@cd ../installer; \
kubectl create ns $(KUBE_NAMESPACE) || true; \
kubectl label ns $(KUBE_NAMESPACE) pod-security.kubernetes.io/enforce=restricted; \
helm upgrade -i config-syncer charts/config-syncer --wait \
--namespace=$(KUBE_NAMESPACE) --create-namespace \
Expand Down
23 changes: 0 additions & 23 deletions charts/config-syncer/.helmignore

This file was deleted.

12 changes: 0 additions & 12 deletions charts/config-syncer/Chart.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions charts/config-syncer/OWNERS

This file was deleted.

94 changes: 0 additions & 94 deletions charts/config-syncer/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions charts/config-syncer/doc.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions charts/config-syncer/templates/NOTES.txt

This file was deleted.

0 comments on commit 90e4df7

Please sign in to comment.