From a7dd6a51604080599d7ef152513f5e5f62759c8a Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Wed, 29 Nov 2017 11:21:21 +0100 Subject: [PATCH] Revert "[wip] K8s (#162)" This reverts commit 88d5475691241957466303d0c0763fa4eb5250b3. --- .infra/kube/00-namespace.yaml | 5 ---- .infra/kube/deployment.yaml | 19 -------------- .infra/kube/ingress-tls.yaml | 22 ---------------- .infra/kube/service.yaml | 13 ---------- .scripts/deploy_gcloud.sh | 47 ----------------------------------- .travis.yml | 13 ---------- 6 files changed, 119 deletions(-) delete mode 100644 .infra/kube/00-namespace.yaml delete mode 100644 .infra/kube/deployment.yaml delete mode 100644 .infra/kube/ingress-tls.yaml delete mode 100644 .infra/kube/service.yaml delete mode 100755 .scripts/deploy_gcloud.sh diff --git a/.infra/kube/00-namespace.yaml b/.infra/kube/00-namespace.yaml deleted file mode 100644 index da874a3..0000000 --- a/.infra/kube/00-namespace.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: tus - diff --git a/.infra/kube/deployment.yaml b/.infra/kube/deployment.yaml deleted file mode 100644 index e170349..0000000 --- a/.infra/kube/deployment.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: tusd - namespace: tus -spec: - replicas: 1 - template: - metadata: - labels: - app: tusd - spec: - containers: - - image: docker.io/tusproject/tusd:latest - imagePullPolicy: Always - args: ["-port=8080","-behind-proxy","-max-size=1000000000"] - name: tusd - ports: - - containerPort: 8080 diff --git a/.infra/kube/ingress-tls.yaml b/.infra/kube/ingress-tls.yaml deleted file mode 100644 index c2dddc2..0000000 --- a/.infra/kube/ingress-tls.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: tusd - namespace: tus - annotations: - kubernetes.io/tls-acme: "true" - kubernetes.io/ingress.class: "nginx" -spec: - tls: - - hosts: - - thesocialcactus.com - secretName: tusd-tls - rules: - - host: thesocialcactus.com - http: - paths: - - path: / - backend: - serviceName: tusd - servicePort: 80 - diff --git a/.infra/kube/service.yaml b/.infra/kube/service.yaml deleted file mode 100644 index b6c6c83..0000000 --- a/.infra/kube/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: tusd - namespace: tus -spec: - ports: - - port: 80 - targetPort: 8080 - protocol: TCP - selector: - app: tusd - diff --git a/.scripts/deploy_gcloud.sh b/.scripts/deploy_gcloud.sh deleted file mode 100755 index 7759ab3..0000000 --- a/.scripts/deploy_gcloud.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -set -o pipefail -set -o errexit -set -o nounset -# set -o xtrace - -# Set magic variables for current FILE & DIR -__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -__root="$(cd "$(dirname "${__dir}")" && pwd)" - -# Store the new image in docker hub -docker build --quiet -t tusproject/tusd:latest -t tusproject/tusd:$TRAVIS_COMMIT ${__root}; -docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; -docker push tusproject/tusd:$TRAVIS_COMMIT; -docker push tusproject/tusd:latest; - -echo $GCLOUD_KEY | base64 --decode -i > ${HOME}/gcloud-service-key.json -gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json - -gcloud --quiet config set project $PROJECT_NAME -gcloud --quiet config set container/cluster $CLUSTER_NAME -gcloud --quiet config set compute/zone ${COMPUTE_ZONE} -gcloud --quiet container clusters get-credentials $CLUSTER_NAME - -kubectl config current-context - -helm init --service-account tiller --upgrade - -kubectl apply -f "${__root}/.infra/kube/00-namespace.yaml" -kubectl apply -f "${__root}/.infra/kube/deployment.yaml" -kubectl apply -f "${__root}/.infra/kube/service.yaml" -kubectl apply -f "${__root}/.infra/kube/ingress-tls.yaml" - -kubectl set image deployment/tusd --namespace=tus tusd=docker.io/tusproject/tusd:$TRAVIS_COMMIT - -kubectl get pods --namespace=tus -kubectl get service --namespace=tus -kubectl get deployment --namespace=tus - - -function cleanup { - printf "Cleaning up...\n" - rm -vf "${HOME}/gcloud-service-key.json" - printf "Cleaning done." -} - -trap cleanup EXIT diff --git a/.travis.yml b/.travis.yml index 5871433..769d1b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ cache: directories: - $HOME/.gimme - $HOME/.frey - - "$HOME/google-cloud-sdk/" env: global: - GO15VENDOREXPERIMENT=1 @@ -26,12 +25,6 @@ script: - ./.scripts/test_all.sh before_deploy: - if [[ "$TRAVIS_TAG" != "" ]]; then ./.scripts/build_all.sh; fi -- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash; fi -- source /home/travis/google-cloud-sdk/path.bash.inc -- gcloud --quiet version -- gcloud --quiet components update -- gcloud --quiet components update kubectl -- curl https://raw.githubusercontent.com/kubernetes/helm/8478fb4fc723885b155c924d1c8c410b7a9444e6/scripts/get | bash deploy: - provider: releases api_key: @@ -49,9 +42,3 @@ deploy: branch: master go: 1.8 repo: tus/tusd -- provider: script - script: .scripts/deploy_gcloud.sh - on: - branch: k8s - go: 1.8 - repo: tus/tusd