Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Created June 16, 2020 06:33
Show Gist options
  • Save pritidesai/92375d3f51286fcfc04029275a7f3876 to your computer and use it in GitHub Desktop.
Save pritidesai/92375d3f51286fcfc04029275a7f3876 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipelinerun-with-pipeline-with-task-to-echo-good-morning
spec:
pipelineSpec:
tasks:
- name: echo-good-morning
metadata:
labels:
custom1: value1
custom2: value2
custom3: value3
annotations:
acustom1: value1
acustom2: value2
taskSpec:
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "Good Morning!"
@pritidesai
Copy link
Author

kubectl get pods -o json
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Pod",
            "metadata": {
                "annotations": {
                    "acustom1": "value1",
                    "acustom2": "value2",
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"tekton.dev/v1beta1\",\"kind\":\"PipelineRun\",\"metadata\":{\"annotations\":{},\"name\":\"pipelinerun-with-pipeline-with-task-to-echo-good-morning\",\"namespace\":\"default\"},\"spec\":{\"pipelineSpec\":{\"tasks\":[{\"metadata\":{\"annotations\":{\"acustom1\":\"value1\",\"acustom2\":\"value2\"},\"labels\":{\"custom1\":\"value1\",\"custom2\":\"value2\",\"custom3\":\"value3\"}},\"name\":\"echo-good-morning\",\"taskSpec\":{\"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-16T06:33:15Z",
                "labels": {
                    "app.kubernetes.io/managed-by": "tekton-pipelines",
                    "custom1": "value1",
                    "custom2": "value2",
                    "custom3": "value3",
                    "tekton.dev/pipeline": "pipelinerun-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/taskRun": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--ns8rx"
                },
                "name": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--65tnc",
                "namespace": "default",
                "ownerReferences": [
                    {
                        "apiVersion": "tekton.dev/v1beta1",
                        "blockOwnerDeletion": true,
                        "controller": true,
                        "kind": "TaskRun",
                        "name": "pipelinerun-with-pipeline-with-task-to-echo-good-morning--ns8rx",
                        "uid": "d250918b-ab7f-4cba-b5cd-236215be151e"
                    }
                ],
                "resourceVersion": "4479450",
                "selfLink": "/api/v1/namespaces/default/pods/pipelinerun-with-pipeline-with-task-to-echo-good-morning--65tnc",
                "uid": "dd2e5027-f6f0-46ff-a01b-7cb1795ad332"
            },
            "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-wlnl9",
                            "--"
                        ],
                        "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-wlnl9\"\ntouch ${tmpfile} \u0026\u0026 chmod +x ${tmpfile}\ncat \u003e ${tmpfile} \u003c\u003c 'script-heredoc-randomly-generated-mm29g'\n#!/usr/bin/env bash\necho \"Good Morning!\"  \n\nscript-heredoc-randomly-generated-mm29g\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:e49160cefabc65071bf0ff6fb1ec958d5afc0efe3c58c2f5b78b4496ee575c5e",
                        "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-16T06:33:17Z",
                        "reason": "PodCompleted",
                        "status": "True",
                        "type": "Initialized"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-16T06:33:20Z",
                        "reason": "PodCompleted",
                        "status": "False",
                        "type": "Ready"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-16T06:33:20Z",
                        "reason": "PodCompleted",
                        "status": "False",
                        "type": "ContainersReady"
                    },
                    {
                        "lastProbeTime": null,
                        "lastTransitionTime": "2020-06-16T06:33:15Z",
                        "status": "True",
                        "type": "PodScheduled"
                    }
                ],
                "containerStatuses": [
                    {
                        "containerID": "docker://0ba0f8c3fbdaa61d9f53acb3b1c431b6cf57fad7b21164dda5b9e84aff76cb10",
                        "image": "ubuntu:latest",
                        "imageID": "docker-pullable://ubuntu@sha256:747d2dbbaaee995098c9792d99bd333c6783ce56150d1b11e333bbceed5c54d7",
                        "lastState": {},
                        "name": "step-echo",
                        "ready": false,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://0ba0f8c3fbdaa61d9f53acb3b1c431b6cf57fad7b21164dda5b9e84aff76cb10",
                                "exitCode": 0,
                                "finishedAt": "2020-06-16T06:33:20Z",
                                "message": "[{\"key\":\"StartedAt\",\"value\":\"2020-06-16T06:33:20.749Z\",\"resourceRef\":{}}]",
                                "reason": "Completed",
                                "startedAt": "2020-06-16T06:33:19Z"
                            }
                        }
                    }
                ],
                "hostIP": "192.168.65.3",
                "initContainerStatuses": [
                    {
                        "containerID": "docker://f1823f31ed23095d79545b84d5475ea5db0a5c48857f35799cffdb7a5967f3d9",
                        "image": "sha256:4a6f2dfa03471bdef939c3946c8f657a0c7dc69a1d0fe7042c8af8084762dde0",
                        "imageID": "docker-pullable://gcr.io/distroless/base@sha256:f79e093f9ba639c957ee857b1ad57ae5046c328998bf8f72b30081db4d8edbe4",
                        "lastState": {},
                        "name": "place-scripts",
                        "ready": true,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://f1823f31ed23095d79545b84d5475ea5db0a5c48857f35799cffdb7a5967f3d9",
                                "exitCode": 0,
                                "finishedAt": "2020-06-16T06:33:16Z",
                                "reason": "Completed",
                                "startedAt": "2020-06-16T06:33:16Z"
                            }
                        }
                    },
                    {
                        "containerID": "docker://5735d4c16beb4fee016bd131a4ba2825e49c327a4d4190599a1ed0c810a30dfb",
                        "image": "sha256:bdbde4364964729541a796a08bdb13e1d483e2bb27614d5101e5bc425801f09a",
                        "imageID": "docker-pullable://pritidesai/entrypoint-bff0a22da108bc2f16c818c97641a296@sha256:e49160cefabc65071bf0ff6fb1ec958d5afc0efe3c58c2f5b78b4496ee575c5e",
                        "lastState": {},
                        "name": "place-tools",
                        "ready": true,
                        "restartCount": 0,
                        "state": {
                            "terminated": {
                                "containerID": "docker://5735d4c16beb4fee016bd131a4ba2825e49c327a4d4190599a1ed0c810a30dfb",
                                "exitCode": 0,
                                "finishedAt": "2020-06-16T06:33:17Z",
                                "reason": "Completed",
                                "startedAt": "2020-06-16T06:33:17Z"
                            }
                        }
                    }
                ],
                "phase": "Succeeded",
                "podIP": "10.1.38.108",
                "qosClass": "BestEffort",
                "startTime": "2020-06-16T06:33:15Z"
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

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