k8sÉÏÔõôװÖÃgitlab²¢»ñÈ¡³õʼÃÜÂë
kubernetes£¨¼ò³Æk8s£©ÊÇÒ»ÖÖÊ¢ÐеÄÈÝÆ÷±àÅÅƽ̨£¬¿ÉÒÔÇáËɵØÀ©Õ¹¡¢ÖÎÀíºÍ°²ÅÅÈÝÆ÷»¯Ó¦ÓóÌÐò¡£¶øgitlabÊÇÒ»¸ö»ùÓÚwebµÄgit´æ´¢¿âÖÎÀí¹¤¾ß£¬¿ÉÒÔÇáËÉÖÎÀíºÍ·ÖÏíÄãµÄ´úÂë¡£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃǽ«ÌÖÂÛÔõÑùÔÚkubernetes¼¯ÈºÉÏ×°ÖÃgitlab£¬²¢»ñÈ¡Æä³õʼÃÜÂë¡£
Ìõ¼þÌõ¼þ
ÔÚ×îÏÈ×°ÖÃGitlab֮ǰ£¬È·±£ÄãµÄKubernetes¼¯ÈºÒѾÍê³ÉÉèÖ㬲¢ÇÒÒѾÆôÓÃÁËHelm¡£
ÏÂÔØGitlab
Ê×ÏÈ£¬Ê¹ÓÃÒÔÏÂÏÂÁîÔÚKubernetes¼¯ÈºÉÏ°²ÅÅGitlab Helm Chart¡£
helm repo add gitlab https://charts.gitlab.io/ helm install gitlab gitlab/gitlab \ --namespace gitlab \ --set global.hosts.domain=example.com \ --set certmanager-issuer.email=you@example.com \ --set gitlab-runner.runners.privileged=true \ --set gitlab-runner.runners.image=runner:latest \ --set gitlab-runner.runners.cache.storePath=/cache \ --set gitlab-runner.runners.cache.type=s3 \ --set gitlab-runner.runners.cache.bucketName=my-bucket \ --set gitlab-runner.runners.cache.s3.region=eu-west-1 \ --set gitlab-runner.runners.cache.shared=true
µÇ¼ºó¸´ÖÆ
ÉÏÊöÏÂÁװÖÃGitlab Helm Chart£¬²¢½«GitlabʵÀýµÄÓòÃûÉèÖÃΪexample.com¡£
»ñÈ¡³õʼÃÜÂë
ÔÚÀֳɰ²ÅÅGitlabºó£¬ÄãÐèÒªÔËÐÐÒÔÏÂÏÂÁîÀ´»ñÈ¡GitlabµÄ³õʼÃÜÂë¡£
kubectl get secret gitlab-gitlab-initial-root-password -ojsonpath='{.data.password}' | base64 --decode ; echo
µÇ¼ºó¸´ÖÆ
ÔËÐÐÏÂÁîºó£¬Ä㽫»ñµÃGitlabµÄ³õʼÃÜÂë¡£
µÇ¼µ½Gitlab
ÏÖÔÚ£¬Ê¹ÓóõʼÃÜÂëµÇ¼µ½Gitlab²¢½¨ÉèÖÎÀíÔ±Õ˺š£ÊäÈë³õʼÃÜÂëºó£¬ÏµÍ³½«ÌáÐÑÄãÉèÖÃеÄÃÜÂë¡£
½áÂÛ
ÏÖÔÚ£¬GitlabÒѾÔÚKubernetes¼¯ÈºÉÏÀÖ³É×°Ö㬲¢ÇÒÄãÒѾÀֳɻñÈ¡ÁËÆä³õʼÃÜÂë¡£ÔÚÕâÀÄã¿ÉÒÔÖ±½ÓµÇ¼²¢Ê¹ÓÃGitlabÖÎÀíÄãµÄ´úÂë¿â£¬ÊµÏÖÍŶÓÐ×÷ºÍ°æ±¾¿ØÖÆ¡£
×ÜÌåÀ´Ëµ£¬×°ÖÃGitlab²¢²»ÄÑ£¬µ«ÒªÏàʶÔõÑù׼ȷÉèÖÃKubernetesºÍHelm£¬²¢»ñÈ¡³õʼÃÜÂ롣ϣÍûÕâƪÎÄÕÂÄܹ»×ÊÖúÄãÀÖ³É×°ÖúÍʹÓÃGitlab¡£
ÒÔÉϾÍÊÇk8sÉÏÔõôװÖÃgitlab²¢»ñÈ¡³õʼÃÜÂëµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡