Remove k8s

This commit is contained in:
Aditya Kulkarni 2021-04-20 20:40:52 -07:00
parent 6341e177f3
commit e13b946657
5 changed files with 0 additions and 207 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,7 +0,0 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ecc-tekton
secrets:
- name: dockerhub-creds

View File

@ -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)