Initial succesfull trigger from zuul comment.

This commit is contained in:
James Pace 2022-08-29 18:46:10 -04:00
parent f967c90da8
commit 52dcab2621
6 changed files with 106 additions and 65 deletions

View File

@ -1,22 +0,0 @@
---
apiVersion: getambassador.io/v3alpha1
kind: Host
metadata:
name: tekton-host
spec:
hostname: "tekton.internal.jpace121.net"
requestPolicy:
insecure:
action: Route
---
apiVersion: getambassador.io/v3alpha1
kind: Listener
metadata:
name: http-listener
spec:
port: 8080
protocol: HTTP
securityModel: INSECURE
hostBinding:
namespace:
from: SELF

View File

@ -1,7 +0,0 @@
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: test-listener-mapping
spec:
prefix: /test-event/
service: el-test-listener.default.svc.cluster.local:8080

28
dns/dns.yaml Normal file
View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
data:
Corefile: |
.:53 {
errors
health
hosts {
192.168.1.138 gerrit.internal.jpace121.net
192.168.1.128 k3s
fallthrough
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
reload
loadbalance
}
NodeHosts: |
#192.168.1.128 k3s

View File

@ -5,54 +5,46 @@ Install:
1. Set up wireguard. 1. Set up wireguard.
2. Download k3s install script from website. 2. Download k3s install script from website.
3. For master: 3. For master:
`INSTALL_K3S_EXEC="server --node-ip '10.100.100.5' --advertise-address '10.100.100.5' --flannel-iface 'wg0'" ./k3s.sh` `./k3s.sh`
4. For node: 4. For node:
`INSTALL_K3S_EXEC="agent --server 'https://10.100.100.5:6443' --token 'K3S_TOKEN' --node-ip '10.100.100.?' --advertise-address '10.100.100.?' --flannel-iface 'wg0'" ./k3s.sh` `curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh -`
"The value to use for K3S_TOKEN is stored at /var/lib/rancher/k3s/server/node-token"
5. Install kubectl on laptop. 5. Install kubectl on laptop.
6. Copy `/etc/rancher/k3s/k3s.yaml` to laptop and change localhost IP to wireguard IP. 6. Copy `/etc/rancher/k3s/k3s.yaml` to laptop and change localhost IP to wireguard IP.
7. `kubectl cluster-info` 7. `kubectl cluster-info`
8. Install tkn CLI. 8. Install tkn CLI.
`https://tekton.dev/docs/cli/` `https://tekton.dev/docs/cli/`
I installed manually. I installed manually.
4. Apply dns updates and rollout restart of codedns:
`kubectl rollout restart -n kube-system deployment/coredns`
Set up Tekton: Install Tekton:
``` ```
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
```
Set up Tekton Dashboard:
```
kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml
```
Port forward locally:
```
kubectl port-forward -n tekton-pipelines service/tekton-dashboard 9097:9097
```
Set up a namespace:
```
kubectl create -f j7s-dev-namspace.json
```
```
kubectl config set-context j7s-dev --namespace=j7s-dev \
--cluster=j7s-dev \
--user=default
```
I'm not sure the above command works...
Stuff I installed from tkn.
```
tkn hub install task git-clone
tkn hub install task ansible-runner
tkn hub install task git-batch-merge
```
Triggers:
Install:
kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml
```
Set up local registry on master.
(I didn't document this process.)
Tell k3s about it:
```sudo vim /etc/rancher/k3s/registries.yaml```
```
configs:
"192.168.1.128:8443":
auth:
username: k3s
password: password
tls:
ca_file: /home/jimmy/registry/certs/domain.crt
```
Restart k3s.
Apply rest of the CRDs.
# Bad Ideas
Amabassador: (for knative) Amabassador: (for knative)
@ -69,3 +61,32 @@ I'm not sure why ambassdor is listening on 80 instead of 8080 given the
settings I applied, or why changing from 8080 to 80 in the seeting borks settings I applied, or why changing from 8080 to 80 in the seeting borks
it. it.
I removed amabassador andput back traefik.
Set up Tekton Dashboard:
```
kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml
```
Port forward locally:
```
kubectl port-forward -n tekton-pipelines service/tekton-dashboard 9097:9097
```
If we later want to do this on an overlay network:
3. For master:
`INSTALL_K3S_EXEC="server --node-ip '10.100.100.5' --advertise-address '10.100.100.5' --flannel-iface 'wg0'" ./k3s.sh`
4. For node:
`INSTALL_K3S_EXEC="agent --server 'https://10.100.100.5:6443' --token 'K3S_TOKEN' --node-ip '10.100.100.?' --advertise-address '10.100.100.?' --flannel-iface 'wg0'" ./k3s.sh`
For now sticking to single node...
Set up a namespace:
```
kubectl create -f j7s-dev-namspace.json
```
```
kubectl config set-context j7s-dev --namespace=j7s-dev \
--cluster=j7s-dev \
--user=default
```
I'm not sure the above command works...

View File

@ -11,6 +11,9 @@ spec:
- ref: message-binding - ref: message-binding
template: template:
ref: pipeline-template ref: pipeline-template
resources:
kubernetesResource:
serviceType: NodePort
--- ---
apiVersion: triggers.tekton.dev/v1beta1 apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerBinding kind: TriggerBinding
@ -28,7 +31,7 @@ metadata:
spec: spec:
params: params:
- name: gitrepositoryurl - name: gitrepositoryurl
value: ssh://gerrit.internal.jpace121.net:29418/ci/test value: ssh://tekton@gerrit.internal.jpace121.net:29418/ci/test
--- ---
apiVersion: triggers.tekton.dev/v1beta1 apiVersion: triggers.tekton.dev/v1beta1

18
triggers/ingress.yaml Normal file
View File

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: git-tekton-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: tekton.internal.jpace121.net
http:
paths:
- path: /test-events/
pathType: Prefix
backend:
service:
name: el-test-listener
port:
number: 8080