This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
308 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: Cluster | ||
apiVersion: kind.sigs.k8s.io/v1alpha3 | ||
nodes: | ||
# the control plane node config | ||
- role: control-plane | ||
# the 2 workers | ||
- role: worker | ||
- role: worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: CI build | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
CHANGE_MINIKUBE_NONE_USER: true | ||
INSTALL_K8S_TOOLS: 1 | ||
IMG: kiwigrid/secret-replicator | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.12 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
|
||
- name: Build | ||
run: make | ||
|
||
- name: Build Docker | ||
run: make docker-build | ||
|
||
install-chart: | ||
name: install-chart | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
strategy: | ||
matrix: | ||
k8s: | ||
# assume no breaking changes between the version | ||
- v1.12.10 | ||
- v1.17.2 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Create kind ${{ matrix.k8s }} cluster | ||
uses: engineerd/[email protected] | ||
with: | ||
config: .github/kind-config.yaml | ||
image: kindest/node:${{ matrix.k8s }} | ||
- name: Run tests | ||
env: | ||
TEST_EXTERNAL_KUBE: true | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: CI build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
|
||
env: | ||
CHANGE_MINIKUBE_NONE_USER: true | ||
INSTALL_K8S_TOOLS: 1 | ||
IMG: kiwigrid/secret-replicator | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.12 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
|
||
- name: Build | ||
run: make | ||
|
||
- name: Build Docker | ||
run: make docker-build | ||
|
||
install-chart: | ||
name: install-chart | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
strategy: | ||
matrix: | ||
k8s: | ||
# assume no breaking changes between the version | ||
- v1.12.10 | ||
- v1.17.2 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Create kind ${{ matrix.k8s }} cluster | ||
uses: engineerd/[email protected] | ||
with: | ||
config: .github/kind-config.yaml | ||
image: kindest/node:${{ matrix.k8s }} | ||
- name: Run tests | ||
env: | ||
TEST_EXTERNAL_KUBE: true | ||
run: make test | ||
|
||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.12 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
|
||
- name: Build | ||
run: make | ||
|
||
- name: Build Docker | ||
run: make docker-build | ||
|
||
- name: Publish to Registry | ||
uses: HurricanKai/Publish-Docker-Github-Action@master | ||
with: | ||
name: kiwigrid/secret-replicator | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Publish Tag to Registry | ||
if: contains(github.ref, 'refs/tags/v') | ||
uses: HurricanKai/Publish-Docker-Github-Action@master | ||
with: | ||
name: kiwigrid/secret-replicator | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
tagging: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2017-2018 IBM Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -e | ||
|
||
if [ -z "${INSTALL_K8S_TOOLS}" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -z ${KUBECTL_VERSION+x} ]; then | ||
KUBECTL_VERSION=v1.10.0 | ||
fi | ||
|
||
if [ -z ${KB_VERSION+x} ]; then | ||
KB_VERSION=1.0.5 | ||
fi | ||
|
||
if [ -z ${KUSTOMIZE_VERSION+x} ]; then | ||
KUSTOMIZE_VERSION=1.0.10 | ||
fi | ||
|
||
echo "installing kubectl" | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
sudo mv ./kubectl /usr/local/bin/ | ||
|
||
echo "installing kubebuilder" | ||
curl -SL "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KB_VERSION}/kubebuilder_${KB_VERSION}_linux_amd64.tar.gz" | tar xz | ||
sudo mv kubebuilder_${KB_VERSION}_linux_amd64 /usr/local/kubebuilder | ||
export KUBEBUILDER_ASSETS=/usr/local/kubebuilder/bin | ||
sudo ln -s ${KUBEBUILDER_ASSETS}/kubebuilder /usr/local/bin/kubebuilder | ||
kubebuilder version | ||
|
||
echo "installing kustomize" | ||
curl -OL "https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64" | ||
sudo chmod +x kustomize_${KUSTOMIZE_VERSION}_linux_amd64 | ||
sudo mv kustomize_${KUSTOMIZE_VERSION}_linux_amd64 /usr/local/bin/kustomize | ||
kustomize version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2017-2018 IBM Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -e | ||
|
||
if [ -z "${INSTALL_MINIKUBE}" ]; then | ||
exit 0 | ||
fi | ||
|
||
MINIKUBE_VERSION=${MINIKUBE_VERSION:-v0.30.0} | ||
BOOTSTRAPPER=${BOOTSTRAPPER:-kubeadm} | ||
KUBE_VERSION=${KUBE_VERSION:-v1.11.0} | ||
|
||
export MINIKUBE_WANTUPDATENOTIFICATION=false | ||
export MINIKUBE_WANTREPORTERRORPROMPT=false | ||
export CHANGE_MINIKUBE_NONE_USER=true | ||
export MINIKUBE_HOME=$HOME | ||
|
||
echo "installing nsenter" | ||
if ! which nsenter; then | ||
curl -L https://github.com/minrk/git-crypt-bin/releases/download/trusty/nsenter > nsenter | ||
chmod +x nsenter | ||
sudo mv nsenter /usr/local/bin/ | ||
fi | ||
|
||
# this is needed for kube > 1.11 | ||
echo "installing crictl" | ||
curl -OL https://github.com/kubernetes-sigs/cri-tools/releases/download/${KUBE_VERSION}/crictl-${KUBE_VERSION}-linux-amd64.tar.gz | ||
sudo tar zxvf crictl-${KUBE_VERSION}-linux-amd64.tar.gz -C /usr/local/bin | ||
rm -f crictl-${KUBE_VERSION}-linux-amd64.tar.gz | ||
|
||
echo "installing minikube" | ||
curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64 | ||
chmod +x minikube | ||
sudo mv minikube /usr/local/bin/ | ||
|
||
echo "starting minikube" | ||
export KUBECONFIG=$HOME/.kube/config | ||
sudo -E minikube start --vm-driver=none --bootstrapper=${BOOTSTRAPPER} --extra-config apiserver.authorization-mode=RBAC --kubernetes-version ${KUBE_VERSION} | ||
echo "update context" | ||
minikube update-context | ||
|
||
echo "waiting minikube to be 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
set -x | ||
|
||
if [ -z "${INSTALL_DIND}" ]; then | ||
exit 0 | ||
fi | ||
|
||
# Install kubernetes-dind-cluster and boot it | ||
wget https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v$TRAVIS_KUBE_VERSION.sh -O $HOME/dind-cluster.sh && chmod +x $HOME/dind-cluster.sh && USE_HAIRPIN=true $HOME/dind-cluster.sh up |