Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Last active June 12, 2020 18:53
Show Gist options
  • Save pritidesai/1679444b8acfd0ad06a9c1e4721e5e2e to your computer and use it in GitHub Desktop.
Save pritidesai/1679444b8acfd0ad06a9c1e4721e5e2e to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: task-echo-good-morning
spec:
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "Good Morning!"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: pipeline-with-pipeline-with-task-to-echo-good-morning
custom1: value1
custom2: value2
custom3: value3
spec:
tasks:
- name: echo-good-morning
taskRef:
name: task-echo-good-morning
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipelinerun-with-pipeline-with-task-to-echo-good-morning
spec:
pipelineRef:
name: pipeline-with-pipeline-with-task-to-echo-good-morning
@pritidesai
Copy link
Author

pritidesai commented Jun 12, 2020

kubectl get pipeline -o json
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "tekton.dev/v1beta1",
            "kind": "Pipeline",
            "metadata": {
                "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"tekton.dev/v1beta1\",\"kind\":\"Pipeline\",\"metadata\":{\"annotations\":{},\"custom1\":\"value1\",\"custom2\":\"value2\",\"custom3\":\"value3\",\"name\":\"pipeline-with-pipeline-with-task-to-echo-good-morning\",\"namespace\":\"default\"},\"spec\":{\"tasks\":[{\"name\":\"echo-good-morning\",\"taskRef\":{\"name\":\"task-echo-good-morning\"}}]}}\n"
                },
                "creationTimestamp": "2020-06-12T18:35:21Z",
                "generation": 1,
                "name": "pipeline-with-pipeline-with-task-to-echo-good-morning",
                "namespace": "default",
                "resourceVersion": "4387390",
                "selfLink": "/apis/tekton.dev/v1beta1/namespaces/default/pipelines/pipeline-with-pipeline-with-task-to-echo-good-morning",
                "uid": "fd7b008b-9b95-4462-b4be-9fc0103e7b57"
            },
            "spec": {
                "tasks": [
                    {
                        "name": "echo-good-morning",
                        "taskRef": {
                            "kind": "Task",
                            "name": "task-echo-good-morning"
                        }
                    }
                ]
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

@pritidesai
Copy link
Author

kubectl get pods -o json
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Pod",
            "metadata": {
                "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"tekton.dev/v1beta1\",\"kind\":\"Task\",\"metadata\":{\"annotations\":{},\"name\":\"task-echo-good-morning\",\"namespace\":\"default\"},\"spec\":{\"steps\":[{\"image\":\"ubuntu\",\"name\":\"echo\",\"script\":\"#!/usr/bin/env bash\\necho \\\"Good Morning!\\\"  \\n\"}]}}\n",
                    "pipeline.tekton.dev/release": "devel",
                    "tekton.dev/ready": "READY"
                },
                "creationTimestamp": "2020-06-12T18:46:28Z",
                "labels": {
                    "app.kubernetes.io/managed-by": "tekton-pipelines",
                    "tekton.dev/pipeline": "pipeline-with-pipeline-with-task-to-echo-good-morning",
                    "tekton.dev/pipelineRun": "pipelinerun-with-pipeline-with-task-to-echo-good-morning",
                    "tekton.dev/pipelineTask": "echo-good-morning",
                    "tekton.dev/task": "task-echo-good-morning",
                    "tekton.dev/taskRun": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--79x4g"
                },
                "name": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--nchqj",
                "namespace": "default",
                "ownerReferences": [
                    {
                        "apiVersion": "tekton.dev/v1beta1",
                        "blockOwnerDeletion": true,
                        "controller": true,
                        "kind": "TaskRun",
                        "name": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--79x4g",
                        "uid": "067bcf43-1707-4004-bbdc-4d34ae768b4d"
                    }
                ],
                "resourceVersion": "4388276",
                "selfLink": "/api/v1/namespaces/default/pods/pipelinerun-with-pipeline-with-task-to-echo-good-morning--nchqj",
                "uid": "07c0609a-099f-438b-925d-ad0540a2ba41"
            },
            "spec": {
                "containers": [
                    {
                        "args": [
                            "-wait_file",
                            "/tekton/downward/ready",
                            "-wait_file_content",
                            "-post_file",
                            "/tekton/tools/0",
                            "-termination_path",
                            "/tekton/termination",
                            "-entrypoint",
                            "/tekton/scripts/script-0-ndt66",
                            "--"
                        ],
                        "command": [
                            "/tekton/tools/entrypoint"
                        ],
                        "env": [
                            {
                                "name": "HOME",
                                "value": "/tekton/home"
                            }
                        ],
                        "image": "ubuntu",
                        "imagePullPolicy": "Always",
                        "name": "step-echo",
                        "resources": {
                            "requests": {
                                "cpu": "0",
                                "ephemeral-storage": "0",
                                "memory": "0"
                            }
                        },
                        "terminationMessagePath": "/tekton/termination",
                        "terminationMessagePolicy": "File",
                        "volumeMounts": [
                            {
                                "mountPath": "/tekton/scripts",
                                "name": "tekton-internal-scripts"
                            },
                            {
                                "mountPath": "/tekton/tools",
                                "name": "tekton-internal-tools"
                            },
                            {
                                "mountPath": "/tekton/downward",
                                "name": "tekton-internal-downward"
                            },
                            {
                                "mountPath": "/workspace",
                                "name": "tekton-internal-workspace"
                            },
                            {
                                "mountPath": "/tekton/home",
                                "name": "tekton-internal-home"
                            },
                            {
                                "mountPath": "/tekton/results",
                                "name": "tekton-internal-results"
                            },
                            {
                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                                "name": "default-token-8bljx",
                                "readOnly": true
                            }
                        ],
                        "workingDir": "/workspace"
                    }
                ],
                "dnsPolicy": "ClusterFirst",
                "enableServiceLinks": true,
                "initContainers": [
                    {
                        "args": [
                            "-c",
                            "tmpfile=\"/tekton/scripts/script-0-ndt66\"\ntouch ${tmpfile} \u0026\u0026 chmod +x ${tmpfile}\ncat \u003e ${tmpfile} \u003c\u003c 'script-heredoc-randomly-generated-dffz5'\n#!/usr/bin/env bash\necho \"Good Morning!\"  \n\nscript-heredoc-randomly-generated-dffz5\n"
                        ],
                        "command": [
                            "sh"
                        ],
                        "image": "gcr.io/distroless/base@sha256:f79e093f9ba639c957ee857b1ad57ae5046c328998bf8f72b30081db4d8edbe4",
                        "imagePullPolicy": "IfNotPresent",
                        "name": "place-scripts",
                        "resources": {},
                        "terminationMessagePath": "/dev/termination-log",
                        "terminationMessagePolicy": "File",
                        "tty": true,
                        "volumeMounts": [
                            {
                                "mountPath": "/tekton/scripts",
                                "name": "tekton-internal-scripts"
                            },
                            {
                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                                "name": "default-token-8bljx",
                                "readOnly": true
                            }
                        ]
                    },
                    {
                        "command": [
                            "cp",
                            "/ko-app/entrypoint",
                            "/tekton/tools/entrypoint"
                        ],
                        "image": "docker.io/pritidesai/entrypoint-bff0a22da108bc2f16c818c97641a296@sha256:786b49a2a382ebc79840bd80ad7d3b54232f587a28d44ec8152833aa10c958ea",
                        "imagePullPolicy": "IfNotPresent",
                        "name": "place-tools",
                        "resources": {},
                        "terminationMessagePath": "/dev/termination-log",
                        "terminationMessagePolicy": "File",
                        "volumeMounts": [
                            {
                                "mountPath": "/tekton/tools",
                                "name": "tekton-internal-tools"
                            },
                            {
                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
                                "name": "default-token-8bljx",
                                "readOnly": true
                            }
                        ]
                    }
                ],
                "nodeName": "docker-desktop",
                "priority": 0,
                "restartPolicy": "Never",
                "schedulerName": "default-scheduler",
                "securityContext": {},
                "serviceAccount": "default",
                "serviceAccountName": "default",
                "terminationGracePeriodSeconds": 30,
                "tolerations": [
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/not-ready",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    },
                    {
                        "effect": "NoExecute",
                        "key": "node.kubernetes.io/unreachable",
                        "operator": "Exists",
                        "tolerationSeconds": 300
                    }
                ],
                "volumes": [
                    {
                        "emptyDir": {},
                        "name": "tekton-internal-workspace"
                    },
                    {
                        "emptyDir": {},
                        "name": "tekton-internal-home"
                    },
                    {
                        "emptyDir": {},
                        "name": "tekton-internal-results"
                    },
                    {
                        "emptyDir": {},
                        "name": "tekton-internal-scripts"
                    },
                    {
                        "emptyDir": {},
                        "name": "tekton-internal-tools"
                    },
                    {
                        "downwardAPI": {
                            "defaultMode": 420,
                            "items": [
                                {
                                    "fieldRef": {
                                        "apiVersion": "v1",
                                        "fieldPath": "metadata.annotations['tekton.dev/ready']"
                                    },
                                    "path": "ready"
                                }
                            ]
                        },
                        "name": "tekton-internal-downward"
                    },
                    {
                        "name": "default-token-8bljx",
                        "secret": {
                            "defaultMode": 420,
                            "secretName": "default-token-8bljx"
                        }
                    }
                ]
            },
            "status": {
                "conditions": [
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-12T18:46:31Z",
                        "reason": "PodCompleted",
                        "status": "True",
                        "type": "Initialized"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-12T18:46:34Z",
                        "reason": "PodCompleted",
                        "status": "False",
                        "type": "Ready"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-12T18:46:34Z",
                        "reason": "PodCompleted",
                        "status": "False",
                        "type": "ContainersReady"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-12T18:46:28Z",
                        "status": "True",
                        "type": "PodScheduled"
                    }
                ],
                "containerStatuses": [
                    {
                        "containerID": "docker://e0e097116563ef3d3c54f14fb8ab6db0be95e4305a6a23ed059b30f148520f9d",
                        "image": "ubuntu:latest",
                        "imageID": "docker-pullable://ubuntu@sha256:747d2dbbaaee995098c9792d99bd333c6783ce56150d1b11e333bbceed5c54d7",
                        "lastState": {},
                        "name": "step-echo",
                        "ready": false,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://e0e097116563ef3d3c54f14fb8ab6db0be95e4305a6a23ed059b30f148520f9d",
                                "exitCode": 0,
                                "finishedAt": "2020-06-12T18:46:34Z",
                                "message": "[{\"key\":\"StartedAt\",\"value\":\"2020-06-12T18:46:33.986Z\",\"resourceRef\":{}}]",
                                "reason": "Completed",
                                "startedAt": "2020-06-12T18:46:32Z"
                            }
                        }
                    }
                ],
                "hostIP": "192.168.65.3",
                "initContainerStatuses": [
                    {
                        "containerID": "docker://6e12935333b3626130b450ef29ac56149bf2c1ec5549e19d5731bc4ee958457f",
                        "image": "sha256:4a6f2dfa03471bdef939c3946c8f657a0c7dc69a1d0fe7042c8af8084762dde0",
                        "imageID": "docker-pullable://gcr.io/distroless/base@sha256:f79e093f9ba639c957ee857b1ad57ae5046c328998bf8f72b30081db4d8edbe4",
                        "lastState": {},
                        "name": "place-scripts",
                        "ready": true,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://6e12935333b3626130b450ef29ac56149bf2c1ec5549e19d5731bc4ee958457f",
                                "exitCode": 0,
                                "finishedAt": "2020-06-12T18:46:29Z",
                                "reason": "Completed",
                                "startedAt": "2020-06-12T18:46:29Z"
                            }
                        }
                    },
                    {
                        "containerID": "docker://a200f20ce283016fe242fd8b862e18365de92b4676b76dea4104c8cdc17f4ef7",
                        "image": "sha256:cc8ad5fd716f5e75245b0dbc4c15e4444d03b5c412b3b98fa1479f3c4dbd5f40",
                        "imageID": "docker-pullable://pritidesai/entrypoint-bff0a22da108bc2f16c818c97641a296@sha256:786b49a2a382ebc79840bd80ad7d3b54232f587a28d44ec8152833aa10c958ea",
                        "lastState": {},
                        "name": "place-tools",
                        "ready": true,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://a200f20ce283016fe242fd8b862e18365de92b4676b76dea4104c8cdc17f4ef7",
                                "exitCode": 0,
                                "finishedAt": "2020-06-12T18:46:30Z",
                                "reason": "Completed",
                                "startedAt": "2020-06-12T18:46:30Z"
                            }
                        }
                    }
                ],
                "phase": "Succeeded",
                "podIP": "10.1.38.78",
                "qosClass": "BestEffort",
                "startTime": "2020-06-12T18:46:28Z"
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment