From e13b946657f79826fc31eae40f41a166de3ff742 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 20 Apr 2021 20:40:52 -0700 Subject: [PATCH] Remove k8s --- kubernetes/tekton/README.md | 85 ---------------------------- kubernetes/tekton/pipeline.yml | 39 ------------- kubernetes/tekton/pipelinerun.yml | 25 -------- kubernetes/tekton/serviceaccount.yml | 7 --- kubernetes/tekton/triggers.yml | 51 ----------------- 5 files changed, 207 deletions(-) delete mode 100644 kubernetes/tekton/README.md delete mode 100644 kubernetes/tekton/pipeline.yml delete mode 100644 kubernetes/tekton/pipelinerun.yml delete mode 100644 kubernetes/tekton/serviceaccount.yml delete mode 100644 kubernetes/tekton/triggers.yml diff --git a/kubernetes/tekton/README.md b/kubernetes/tekton/README.md deleted file mode 100644 index ddf4d28..0000000 --- a/kubernetes/tekton/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Tekton CI -The configurations in this directory are for automating lightwalletd operations using Tekton. - -Currently new tags will trigger a docker build and push to https://hub.docker.com/r/electriccoinco/lightwalletd - -## Testing - -### Requirements -- `kind` installed -- `docker` installed -- A Docker Hub account (create a new one if you want, its free!) - -### Setup - -#### Log into Docker Hub -Just run the command: -``` -docker login -``` -This creates a `config.json` file that we're going to send to tekton and contains your Docker Hub password! - -More info: https://github.com/tektoncd/pipeline/blob/master/docs/auth.md - -#### Create a kind cluster -``` -kind create cluster --name tekton-testing-zcashd_exporter -``` -#### Create a Kubernetes secret containing your Docker hub creds -``` -kubectl create secret generic dockerhub-creds \ - --from-file=.dockerconfigjson=~/.docker/config.json \ - --type=kubernetes.io/dockerconfigjson -``` - -#### Create a service account to use those creds -``` -kubectl apply -f serviceaccount.yml -``` - -#### Install Tekton -``` -kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.15.2/release.yaml -kubectl apply -f https://github.com/tektoncd/dashboard/releases/download/v0.9.0/tekton-dashboard-release.yaml -``` -#### Install the Tekton Catalog tasks -These are predefined tasks from the `tektoncd/catalog` collection on github. - -``` -kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/git-clone/0.2/git-clone.yaml -kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/kaniko/0.1/kaniko.yaml -``` - -#### Create the pipeline -``` -kubectl apply -f pipeline.yml -``` - -#### Edit the `PipelineRun` - -This object holds all of your pipeline instance parameters. - -You **must** edit (unless somehow you got access to my Docker Hub account) -Change `electriccoinco` to your Docker Hub account name. -``` - - name: dockerHubRepo - value: electriccoinco/lightwalletd -``` -You can also change the `gitTag` and `gitRepositoryURL` values if you want to try building off some other commit, or you fork the code to your own repo. - -### Run the pipeline! - -You can do this as many times as you want, each one will create a new pipelinerun. -``` -kubectl create -f pipelinerun.yml -``` - - -### View the dashboard for status - -Forward a port from inside the kubernetes cluster to your laptop. -``` -kubectl --namespace tekton-pipelines port-forward svc/tekton-dashboard 9097:9097 & -``` - -The browse to http://localhost:9097/#/namespaces/default/pipelineruns \ No newline at end of file diff --git a/kubernetes/tekton/pipeline.yml b/kubernetes/tekton/pipeline.yml deleted file mode 100644 index ca9148e..0000000 --- a/kubernetes/tekton/pipeline.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: lightwalletd-tag-pipeline -spec: - params: - - name: gitTag - - name: gitRepositoryURL - - name: dockerHubRepo - workspaces: - - name: source - tasks: - - name: git-clone - taskRef: - name: git-clone - workspaces: - - name: output - workspace: source - params: - - name: url - value: $(params.gitRepositoryURL) - - name: revision - value: $(params.gitTag) - - name: refspec - value: +refs/tags/*:refs/remotes/origin/tags/* +refs/heads/*:refs/heads/* - - name: verbose - value: "true" - - name: kaniko-build - taskRef: - name: kaniko - runAfter: - - git-clone - params: - - name: IMAGE - value: $(params.dockerHubRepo):$(params.gitTag) - workspaces: - - name: source - workspace: source \ No newline at end of file diff --git a/kubernetes/tekton/pipelinerun.yml b/kubernetes/tekton/pipelinerun.yml deleted file mode 100644 index dd7d8a9..0000000 --- a/kubernetes/tekton/pipelinerun.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - generateName: lightwalletd-tag-pipeline- -spec: - serviceAccountName: ecc-tekton - pipelineRef: - name: lightwalletd-tag-pipeline - workspaces: - - name: source - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - params: - - name: gitTag - value: GetMempoolTx - - name: gitRepositoryURL - value: https://github.com/zcash/lightwalletd.git - - name: dockerHubRepo - value: electriccoinco/lightwalletd diff --git a/kubernetes/tekton/serviceaccount.yml b/kubernetes/tekton/serviceaccount.yml deleted file mode 100644 index 4178dd1..0000000 --- a/kubernetes/tekton/serviceaccount.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: ecc-tekton -secrets: - - name: dockerhub-creds \ No newline at end of file diff --git a/kubernetes/tekton/triggers.yml b/kubernetes/tekton/triggers.yml deleted file mode 100644 index ebecb9e..0000000 --- a/kubernetes/tekton/triggers.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -apiVersion: triggers.tekton.dev/v1alpha1 -kind: TriggerBinding -metadata: - name: lightwalletd-tag-binding -spec: - params: - - name: gitTag - value: $(body.tag) - - name: gitRepositoryURL - value: $(body.repository.git_http_url) - - name: dockerHubRepo - value: electriccoinco/zcashd_exporter ---- -apiVersion: triggers.tekton.dev/v1alpha1 -kind: TriggerTemplate -metadata: - name: lightwalletd-tag-pipeline-template -spec: - params: - - name: gitTag - description: Git tag - - name: gitRepositoryURL - description: Git repo url - - name: dockerHubRepo - description: Docker Hub repository name - resourcetemplates: - - apiVersion: tekton.dev/v1beta1 - kind: PipelineRun - metadata: - generateName: lightwalletd-tag-pipeline- - spec: - serviceAccountName: ecc-tekton - pipelineRef: - name: lightwalletd-tag-pipeline - workspaces: - - name: source - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - params: - - name: gitRepositoryURL - value: $(params.gitRepositoryURL) - - name: gitTag - value: $(params.gitTag) - - name: dockerHubRepo - value: $(params.dockerHubRepo)