Replicated Ship 本地 kubernetes 环境试用

关于介绍可以参考 https://github.com/replicatedhq/ship 或者我写的一个比较简单的demo
https://www.cnblogs.com/rongfengliang/p/10025786.html

测试使用的是github repo, 如果不是,命令行工具会有提示,告诉我们格式

工具安装

可以参考 https://www.cnblogs.com/rongfengliang/p/10025786.html

brew tap replicatedhq/ship
brew install ship

kubernetesmanifests

备注需要是github 格式的repo

  • manifests 文件内容
---
# Source: nginx-app/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: appdemorong-nginx-app
  labels:
    app.kubernetes.io/name: nginx-app
    helm.sh/chart: nginx-app-0.1.0
    app.kubernetes.io/instance: appdemorong
    app.kubernetes.io/managed-by: Tiller
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: http
      protocol: TCP
      name: http
  selector:
    app.kubernetes.io/name: nginx-app
    app.kubernetes.io/instance: appdemorong

---
# Source: nginx-app/templates/deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: appdemorong-nginx-app
  labels:
    app.kubernetes.io/name: nginx-app
    helm.sh/chart: nginx-app-0.1.0
    app.kubernetes.io/instance: appdemorong
    app.kubernetes.io/managed-by: Tiller
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: nginx-app
      app.kubernetes.io/instance: appdemorong
  template:
    metadata:
      labels:
        app.kubernetes.io/name: nginx-app
        app.kubernetes.io/instance: appdemorong
    spec:
      containers:
        - name: nginx-app
          image: "nginx:stable"
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
            {}


---
# Source: nginx-app/templates/ingress.yaml

使用ship 部署

  • init
ship init github.com/rongfengliang/ship-k8s-demo

从下图可以看出,会自动进行项目类型的判断,还是很方便的,之后会提示是否使用ui工具,进行配置
效果

  • UI 配置(生成kustomize&&部署文件)



    上边的确认之后,会自动退出UI
  • 生成的文件
  • 部署
    参考ui的说明就可以了
kubectl apply -f rendered.yaml

  • 变更捕获&&更新
    修改github,查看变更信息
ship watch && ship update


修改镜像为openresty

参考资料

https://github.com/replicatedhq/ship
https://www.cnblogs.com/rongfengliang/p/10025786.html

posted on   荣锋亮  阅读(416)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2017-11-27 cargo rust 包管理工具
2017-11-27 container-diff 谷歌开源镜像分析工具使用
2016-11-27 Disque
2015-11-27 node js 常用模块

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示