<p>I have a Tekton <code>Pipeline</code> and <code>PipelineRun</code> definitions. But, I couldn't achieve to run <code>Pipeline</code> via passing parameter.</p>
<pre><code>apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: build-deploy-
  labels:
    tekton.dev/pipeline: build-deploy
spec:
  serviceAccountName: tekton-build-bot
  pipelineRef:
    name: build-deploy
  params:
    - name: registry-address
      value: $(REG_ADDRESS)
    - name: repo-address
      #value: $(REPO_ADDRESS)
      value: $(REPO_ADDRESS)
    - name: repo-name
      value: $(REPO_NAME)
    - name: version
      value: $(VERSION)
  workspaces:
    - name: source
      persistentVolumeClaim:
        claimName: my-pvc
</code></pre>
<p>How can I pass while parameters while trying to run that runner with the following command <code>kubectl create -f pipelinerun.yaml</code>?</p>
<p>Example:</p>
<p><code>value: $(REG_ADDRESS)</code> -&gt; I wanted to pass registry address as right before the running pipeline instead of giving hard-coded constant.</p>

jdev
<p>You cannot pass those parameters when using <code>kubectl create</code>.</p>
<p>There are two alternatives:</p>
<h2>Use tkn cli</h2>
<p>You can use <a href="https://github.com/tektoncd/cli" rel="nofollow noreferrer">tkn</a>, a purpose made CLI for Tekton. Then you can start a run of a Pipeline with, e.g.:</p>
<pre><code>tkn pipeline start build-deploy \
    --param registry-address=yay \
    --param repo-name=nay \
    --workspace name=source,claimName=my-pvc
</code></pre>
<h2>Initiate pipeline with Trigger</h2>
<p>You can setup a <a href="https://github.com/tektoncd/triggers" rel="nofollow noreferrer">Trigger</a> that initiates runs of your Pipeline on certain events, e.g. when you push to Git.</p>
<p>Then your <code>PipelineRun</code> template with parameter mapping is done using a <a href="https://github.com/tektoncd/triggers/blob/main/docs/triggertemplates.md" rel="nofollow noreferrer">TriggerTemplate</a></p>
