zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    ZOJ 1002 Fire Net
    Uva 12889 One-Two-Three
    URAL 1881 Long problem statement
    URAL 1880 Psych Up's Eigenvalues
    URAL 1877 Bicycle Codes
    URAL 1876 Centipede's Morning
    URAL 1873. GOV Chronicles
    Uva 839 Not so Mobile
    Uva 679 Dropping Balls
    An ac a day,keep wa away
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/10026998.html
Copyright © 2011-2022 走看看