将私有GitHub存储库挂载到pod的卷中

时间:2015-09-01 11:18:21

标签: github docker volume kubernetes

是否有人将私有GitHub存储库安装到kubernetes pod卷中?

实现这一目标的最佳方法是什么? 我想到了两种可能的方式:

  1. 在HTTPS存储库URL中使用用户/密码
  2. 在计算机上使用私人SSH密钥
  3. 我更喜欢第二种,但我无法确定哪个用户正在拉存储库以为其提供适当的SSH配置。

    有什么想法吗?

1 个答案:

答案 0 :(得分:1)

GitHub允许使用https URL中的OAuth令牌克隆存储库:

<?php // Create a 100*30 image $im = imagecreate(300, 300); // White background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); function writeCenteredText($image,$y,$textString,$color) { // half way of image = (width / 2) // half way of text = ($strPixLen / 2); //split the string into chunks that fit the image width $splitString = str_split($textString, imagesx($image) / imagefontwidth(1) ); foreach($splitString as $key => $value) { $strPixLen = strlen($value) * imagefontwidth(1); $x = (imagesx($image) / 2) - ($strPixLen / 2); imagestring($image, 1, $x, imagefontheight(1) * $y , $value, $color); ++$y; } } writeCenteredText($im,0,'Centered Text',$textcolor); writeCenteredText($im, 1 ,'Centered Text2',$textcolor); writeCenteredText($im, 2 ,'Longer Centered Text',$textcolor); writeCenteredText($im, 3 ,'This is really long Centered Text',$textcolor); writeCenteredText($im, 4 ,'If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length.',$textcolor); // Output the image header('Content-type: image/png'); imagepng($im); imagedestroy($im); exit; ?>

https://help.github.com/articles/creating-an-access-token-for-command-line-use/