当前位置: 首页 > news >正文

使用 kind 集群安装运行极狐GitLab Runner【上】

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

关于 kind

kind 是一个用来运行本地 Kubernetes 机群的工具,主要使用 Docker 容器来做为 “nodes”。kind 的主要设计目的是为了测试 Kubernetes 本身,但是也可以在本地研发或者运行 CI 的时候使用 kind。

kind is a tool for running local Kubernetes clusters using Docker container “nodes”. kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

kind 的安装

kind 的安装非常方便,根据不同的 OS 安装即可:

Linux 安装:

# For AMD64 / x86_64
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
# For ARM64
[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-arm64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

macOS 安装:

# For Intel Macs
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-amd64
# For M1 / ARM Macs
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-arm64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

Windows 安装:

$ curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.22.0/kind-windows-amd64
Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe

本文以 macOS 安装为例,直接使用 brew 安装:

$ brew install kind

安装完毕,可以使用 version 或者 help 命令进行查看:

$ kind --version
kind version 0.17.0$ kind --help
kind creates and manages local Kubernetes clusters using Docker container 'nodes'Usage:kind [command]Available Commands:build       Build one of [node-image]completion  Output shell completion code for the specified shell (bash, zsh or fish)create      Creates one of [cluster]delete      Deletes one of [cluster]export      Exports one of [kubeconfig, logs]get         Gets one of [clusters, nodes, kubeconfig]help        Help about any commandload        Loads images into nodesversion     Prints the kind CLI versionFlags:-h, --help              help for kind--loglevel string   DEPRECATED: see -v instead-q, --quiet             silence all stderr output-v, --verbosity int32   info log verbosity, higher value produces more output--version           version for kindUse "kind [command] --help" for more information about a command.

kind 的使用

可以使用 kind 创建一个本地 kubernetes 集群:

$ kind create cluster --name jh-gitlab
Creating cluster "jh-gitlab" ...✓ Ensuring node image (kindest/node:v1.25.3) 🖼✓ Preparing nodes 📦✓ Writing configuration 📜✓ Starting control-plane 🕹️✓ Installing CNI 🔌✓ Installing StorageClass 💾
Set kubectl context to "kind-jh-gitlab"
You can now use your cluster with:kubectl cluster-info --context kind-jh-gitlabThanks for using kind! 😊

查看创建好的集群:

$ kind get clusters
jh-gitlab
kind

切换到想要测试的集群:

$ kubectl cluster-info --context kind-jh-gitlab
Kubernetes control plane is running at https://127.0.0.1:61452
CoreDNS is running at https://127.0.0.1:61452/api/v1/namespaces/kube-system/services/kube-dns:dns/proxyTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

查看集群的 node、ns 等:

$ kubectl get ns
NAME                 STATUS   AGE
default              Active   42h
kube-node-lease      Active   42h
kube-public          Active   42h
kube-system          Active   42h
local-path-storage   Active   42h$ kubectl get nodes
NAME                      STATUS   ROLES           AGE   VERSION
jh-gitlab-control-plane   Ready    control-plane   42h   v1.25.3

现在 kubernetes 集群安装成功,接下来就可以使用此集群安装极狐GitLab Runner 了。可以参考下篇文章。

更多关于极狐GitLab 的最佳实践,可以搜索关注公众号【极狐GitLab】或者登录极狐GitLab 官网进行学习。

http://www.lryc.cn/news/305183.html

相关文章:

  • wine 源码 vk3d wine-gecko wine-mono 各版本 国内下载地址 中国科技技术大学源
  • 【ArcGIS微课1000例】0104:二位面状数据转三维多面体(建筑物按高度拉伸)
  • jquery简介与解析
  • Apache Commons开源的工具库介绍
  • SQL语法法则
  • Java命令模式:让请求成为对象
  • 研究生摆烂摆烂的一个寒假
  • singularity-ce-4.1.0 + go 完整安装步骤,及报错解决
  • 笔记-电感充放电过程状态记录
  • 石头剪刀布游戏(C语言)
  • 《卓有成效的管理者》
  • 基于RK3399 Android11适配OV13850 MIPI摄像头
  • 学生个性化成长平台搭建随笔记
  • XTuner InternLM-Chat 个人小助手认知微调实践
  • 编程笔记 Golang基础 025 列表
  • Rollup + Ts
  • 5个精美的wordpress中文企业主题模板
  • 【数据分享】2011-2023年我国地级市逐月二手房房价数据(Excel/Shp格式)
  • 鸿蒙会成为安卓的终结者吗?
  • Sora横空出世!AI将如何撬动未来?
  • Selenium浏览器自动化测试框架详解
  • XGB-11:随机森林
  • 超平面介绍
  • 【苍穹外卖】一些开发总结
  • Python 3 中,`asynchat`异步通信
  • RAW 编程接口 TCP 简介
  • Oracle EBS FA折旧回滚的分录追溯
  • sql注入 [极客大挑战 2019]FinalSQL1
  • 持续集成,持续交付和持续部署的概念,以及GitLab CI / CD的介绍
  • [Java 项目亮点] 三层限流设计