<p>I want to create a deployment with GitHub URL using<br>
<code>kubectl create -f github.com/deployment.yaml</code><br>
That <code>deployment.yaml</code> file is located in  my private GitHub repository.<br>
How can I authenticate my kubectl to use my GitHub private repo and create that deployment?</p>

AATHITH RAJENDRAN
<p>You could simply:</p>

<ul>
<li><a href="https://gist.github.com/Integralist/9482061" rel="nofollow noreferrer">curl the file from the private repo</a></li>
<li><a href="https://unix.stackexchange.com/a/505831/7490">pass its content to kubectl create -f</a></li>
</ul>

<p>That is, from <a href="https://gist.github.com/madrobby/9476733#gistcomment-2817366" rel="nofollow noreferrer">this example</a>:</p>

<pre><code>USER="me"
PASSWD="mypasswd"
OUTPUT_FILEPATH="./foo"
OWNER="mycompany"
REPOSITORY="boo"
RESOURCE_PATH="project-x/a/b/c.py"
TAG="my_unit_test"
curl \
    -u "$USER:$PASSWD" \
    -H 'Accept: application/vnd.github.v4.raw' \
    -o "$OUTPUT_FILEPATH" \
    -L "https://api.github.com/repos/$OWNER/$REPOSITORY/contents/$RESOURCE_PATH?ref=$TAG"
| kubectl create -f /dev/stdin
</code></pre>
