提交 abe688ec 编写于 作者: A Alan Greene 提交者: tekton-robot

Update Katacoda scenarios to Kubernetes 1.18

Update all Katacoda scenarios to run on Kubernetes 1.18, with
a 2 node cluster.

Fix some issues in the tasks and runs scenarios that seem to have
been undone in rebases before they were merged.

Update the Dashboard scenario to run the latest Pipeline and
Dashboard versions at time of writing.

Remove the use of the ingress in the Dashboard scenario since
it appears unstable on Katacoda with kubernetes 1.18. Using a
port-forward is sufficient for this scenario.
上级 648a2291
![logo](https://github.com/tektoncd/website/tree/master/tutorials/katacoda/getting-started/images/logo.png?raw=true)
![logo](https://raw.githubusercontent.com/tektoncd/website/master/tutorials/katacoda/logo.png)
Tekton is a powerful and flexible open-source framework for creating
CI/CD systems, allowing developers to build, test, and deploy across
Tekton is a powerful and flexible open-source framework for creating
CI/CD systems, allowing developers to build, test, and deploy across
cloud providers and on-premise systems.
In this scenario, you will build a basic CI/CD workflow with Tekton that
......
......@@ -7,7 +7,8 @@
"steps": [
{
"title": "Setup",
"text": "setup.md"
"text": "setup.md",
"foreground": "init.sh"
},
{
"title": "Basics",
......@@ -23,8 +24,7 @@
}
],
"intro": {
"text": "intro.md",
"courseData": "init.sh"
"text": "intro.md"
},
"finish": {
"text": "finish.md"
......@@ -34,6 +34,6 @@
"uilayout": "terminal"
},
"backend": {
"imageid": "kubernetes"
"imageid": "kubernetes-cluster-running:1.18"
}
}
![logo](https://github.com/tektoncd/website/tree/master/tutorials/katacoda/getting-started/images/logo.png?raw=true)
![logo](https://raw.githubusercontent.com/tektoncd/website/master/tutorials/katacoda/logo.png)
Tekton is Kubernetes-native and works well with widely-adopted CI/CD solutions,
such as [Jenkins](https://jenkins.io/)/[Jenkins X](https://jenkins-x.io/),
[Skaffold](https://skaffold.dev/), and [Knative](https://knative.dev/).
It is flexible, and supports many advanced CI/CD patterns, including
rolling, blue/green, and canary deployment.
[Tekton](https://tekton.dev) is a cloud native continuous integration and
delivery (CI/CD) solution. It allows developers to build, test, and deploy
across cloud providers and on-premises systems.
In this scenario, you will learn about Tekton TaskRuns and PipelineRuns,
the custom resources in Tekton for running a specific task or pipeline.
......
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
# The name of the pipeline resource
......
......@@ -10,9 +10,9 @@ spec:
steps:
- name: pytest
image: python
script : |
#!/bin/bash
cd /workspace/git/runs/src/app
pip install -r requirements.txt
pip install -r dev_requirements.txt
pytest .
script: |
#!/bin/bash
cd /workspace/git/tutorials/katacoda/runs/src/app
pip install -r requirements.txt
pip install -r dev_requirements.txt
pytest .
......@@ -5,8 +5,8 @@ metadata:
spec:
taskRef:
name: example-task
inputs:
resources:
resources:
inputs:
- name: git
resourceRef:
name: example-git
......@@ -5,5 +5,6 @@ metadata:
spec:
taskRef:
...
inputs:
resources:
inputs:
...
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
# The name of the pipeline resource
name: example-git
spec:
type: git
params:
# The revision/branch of the repository
- name: revision
value: master
# The URL of the repository
- name: url
value: https://github.com/tektoncd/website/
......@@ -7,7 +7,8 @@
"steps": [
{
"title": "Setup",
"text": "setup.md"
"text": "setup.md",
"foreground": "init.sh"
},
{
"title": "Basics",
......@@ -35,8 +36,7 @@
}
],
"intro": {
"text": "intro.md",
"courseData": "init.sh"
"text": "intro.md"
},
"finish": {
"text": "finish.md"
......@@ -46,6 +46,6 @@
"uilayout": "terminal"
},
"backend": {
"imageid": "kubernetes"
"imageid": "kubernetes-cluster-running:1.18"
}
}
![logo](https://github.com/tektoncd/website/tree/master/tutorials/katacoda/getting-started/images/logo.png?raw=true)
![logo](https://raw.githubusercontent.com/tektoncd/website/master/tutorials/katacoda/logo.png)
Tekton is Kubernetes-native and works well with widely-adopted CI/CD solutions,
such as [Jenkins](https://jenkins.io/)/[Jenkins X](https://jenkins-x.io/),
[Skaffold](https://skaffold.dev/), and [Knative](https://knative.dev/).
It is flexible, and supports many advanced CI/CD patterns, including
rolling, blue/green, and canary deployment.
[Tekton](https://tekton.dev) is a cloud native continuous integration and
delivery (CI/CD) solution. It allows developers to build, test, and deploy
across cloud providers and on-premises systems.
In this scenario, you will learn about Tekton tasks, the basic building block
of CI/CD pipelines in Tekton. More specifically, **you will use a Tekton task
......
......@@ -3,8 +3,8 @@ kind: Task
metadata:
name: example-task
spec:
inputs:
resources:
resources:
inputs:
- name: git
type: git
steps:
......@@ -14,7 +14,7 @@ spec:
- /bin/bash
- -c
args:
- cd /workspace/git/tasks/src/client && pip install -r requirements.txt && pip install -r dev_requirements.txt && pytest .
- cd /workspace/git/tutorials/katacoda/tasks/src/client && pip install -r requirements.txt && pip install -r dev_requirements.txt && pytest .
volumeMounts:
- name: credential
mountPath: /etc/credential
......@@ -34,4 +34,4 @@ spec:
# Here you will change the directory, install all the dependencies the app uses,
# and run the app
args:
- git clone https://github.com/tektoncd/website.git && cd ./tutorials/katacoda/tasks/src/server && pip install -r requirements.txt && python main.py
- git clone https://github.com/tektoncd/website.git && cd ./website/tutorials/katacoda/tasks/src/server && pip install -r requirements.txt && python main.py
......@@ -3,8 +3,8 @@ kind: TaskRun
metadata:
name: example-task-run
spec:
inputs:
resources:
resources:
inputs:
- name: git
resourceRef:
name: example-git
......
......@@ -3,8 +3,8 @@ kind: Task
metadata:
name: example-task
spec:
inputs:
resources:
resources:
inputs:
...
steps:
...
......
......@@ -46,7 +46,7 @@
"uilayout": "terminal-iframe"
},
"backend": {
"imageid": "kubernetes",
"imageid": "kubernetes-cluster-running:1.18",
"port": "80"
}
}
\ No newline at end of file
}
......@@ -11,9 +11,7 @@ Now, let's begin!
## Install the Tekton Dashboard Prerequisites
- [Tekton Pipelines](https://github.com/tektoncd/pipeline/blob/master/docs/install.md)
`kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.10.1/release.yaml`{{execute}}
- [Tekton Triggers](https://github.com/tektoncd/triggers/blob/master/docs/install.md) (optional)
`kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/previous/v0.3.1/release.yaml`{{execute}}
`kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.15.2/release.yaml`{{execute}}
Verify the pods are running:
`kubectl get pods -n tekton-pipelines`{{execute}}
......@@ -22,7 +20,7 @@ Verify the pods are running:
For reference, the installation instructions are [here](https://github.com/tektoncd/dashboard#install-dashboard). To install the Tekton Dashboard, run the following
command:
`kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/previous/v0.5.3/tekton-dashboard-release.yaml`{{execute}}
`kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/previous/v0.8.2/tekton-dashboard-release.yaml`{{execute}}
<!-- `kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml`{{execute}} -->
......@@ -31,45 +29,16 @@ Verify the Dashboard pod is running:
## Expose the Tekton Dashboard
### Install Ingress controller
Install the nginx ingress controller into the `ingress-nginx` namespace:
```bash
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud/deploy.yaml
```{{execute}}
Verify the ingress controller pod is running:
```bash
kubectl get pods -n ingress-nginx
```{{execute}}
### Create Ingress for the Tekton Dashboard
View the Tekton Dashboard Service:
`kubectl get svc tekton-dashboard -n tekton-pipelines`{{execute}}
The Tekton Dashboard Service is exposed on port `9097`. So, create an Ingress
The Tekton Dashboard Service is exposed on port `9097`. So, set up a port forward
for the `tekton-dashboard` Service on port `9097`:
```bash
cat << EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: tekton-dashboard
namespace: tekton-pipelines
spec:
backend:
serviceName: tekton-dashboard
servicePort: 9097
EOF
kubectl port-forward -n tekton-pipelines --address=0.0.0.0 service/tekton-dashboard 80:9097 > /dev/null 2>&1 &
```{{execute}}
Verify the Ingress was created:
`kubectl get ingress -n tekton-pipelines`{{execute}}
## Open the Tekton Dashboard
Open the `Dashboard` tab in your Katacoda window, or click on the following link:
......
......@@ -18,8 +18,12 @@ Verify both the `build` and `deploy` tasks have passed.
## Open the Deployed App
MyApp will be running on port `3000`. Click on the following link to open the
app:
Expose the app on port 3000:
```bash
kubectl port-forward --address=0.0.0.0 service/myapp 3000:3000 > /dev/null 2>&1 &
```{{execute}}
Click on the following link to open the app:
https://[[HOST_SUBDOMAIN]]-3000-[[KATACODA_HOST]].environments.katacoda.com/
![View MyApp screenshot.](./assets/view-myapp.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册