zoukankan      html  css  js  c++  java
  • kube-batch(一)安装

    安装

    官方:https://github.com/kubernetes-sigs/kube-batch

    下载镜像

    安装

    官方:https://github.com/kubernetes-sigs/kube-batch

    下载镜像

    image-20200709105911547

    使用v0.5

    docker pull kubesigs/kube-batch:v0.5
    

    两种安装方式

    • 第一种:使用yaml安装
    • 第二种:使用helm安装

    第一种:使用yaml 安装方式

    【Step1】创建 CRD

    kubectl create -f scheduling_v1alpha1_podgroup.yaml
    kubectl create -f scheduling_v1alpha2_podgroup.yaml
    kubectl create -f scheduling_v1alpha1_queue.yaml
    kubectl create -f scheduling_v1alpha2_queue.yaml
    

    scheduling_v1alpha1_podgroup.yaml

     apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: podgroups.scheduling.incubator.k8s.io
      annotations:
        "helm.sh/hook": "crd-install"
    spec:
      group: scheduling.incubator.k8s.io
      names:
        kind: PodGroup
        plural: podgroups
      scope: Namespaced
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                minMember:
                  format: int32
                  type: integer
                queue:
                  type: string
                priorityClassName:
                  type: string
              type: object
            status:
              properties:
                succeeded:
                  format: int32
                  type: integer
                failed:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha1
    

    scheduling_v1alpha2_podgroup.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: podgroups.scheduling.sigs.dev
    spec:
      group: scheduling.sigs.dev
      names:
        kind: PodGroup
        plural: podgroups
      scope: Namespaced
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                minMember:
                  format: int32
                  type: integer
                queue:
                  type: string
                priorityClassName:
                  type: string
              type: object
            status:
              properties:
                succeeded:
                  format: int32
                  type: integer
                failed:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha2
    
    

    scheduling_v1alpha1_queue.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: queues.scheduling.incubator.k8s.io
      annotations:
        "helm.sh/hook": "crd-install"
    spec:
      group: scheduling.incubator.k8s.io
      names:
        kind: Queue
        plural: queues
      scope: Cluster
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                weight:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha1
    
    

    scheduling_v1alpha2_queue.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: queues.scheduling.sigs.dev
    spec:
      group: scheduling.sigs.dev
      names:
        kind: Queue
        plural: queues
      scope: Cluster
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                weight:
                  format: int32
                  type: integer
              type: object
            status:
              properties:
                unknown:
                  format: int32
                  type: integer
                pending:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha2
    
    

    【Step2】 创建deployment

    kubectl create -f deployment.yaml
    

    deployment.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kube-batch
      labels:
        chart: kube-batch-kube-batch
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: kube-batch
      template:
        metadata:
          labels:
            app: kube-batch
        spec:
          containers:
          - name: kube-batch
            image: 10.220.54.6:8088/kuai/kube-batch:v0.5
            args: ["--logtostderr", "--v", "3"]
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                cpu: 2000m
                memory: 2048Mi
              requests:
                cpu: 2000m
                memory: 2048Mi
    

    【Step3】创建Queue

    apiVersion: scheduling.incubator.k8s.io/v1alpha1
    kind: Queue
    metadata:
      name: default
    spec:
      weight: 1
    

    第二种:使用helm 安装方式

    【Step1】 下载kube-batch

    #mkdir -p $GOPATH/src/github.com/kubernetes-sigs/
    
    #cd $GOPATH/src/github.com/kubernetes-sigs/
    
    #git clone http://github.com/kubernetes-sigs/kube-batch
    
    

    【Step2】通过helm部署kube-batch

    #helm install $GOPATH/src/github.com/kubernetes-sigs/kube-batch/deployment/kube-batch --namespace kube-system
    

    【Step3】查看是否安装成功后

    #helm list
    

    使用v0.5

    docker pull kubesigs/kube-batch:v0.5
    

    两种安装方式

    • 第一种:使用yaml安装
    • 第二种:使用helm安装

    第一种:使用yaml 安装方式

    【Step1】创建 CRD

    kubectl create -f scheduling_v1alpha1_podgroup.yaml
    kubectl create -f scheduling_v1alpha2_podgroup.yaml
    kubectl create -f scheduling_v1alpha1_queue.yaml
    kubectl create -f scheduling_v1alpha2_queue.yaml
    

    scheduling_v1alpha1_podgroup.yaml

     apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: podgroups.scheduling.incubator.k8s.io
      annotations:
        "helm.sh/hook": "crd-install"
    spec:
      group: scheduling.incubator.k8s.io
      names:
        kind: PodGroup
        plural: podgroups
      scope: Namespaced
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                minMember:
                  format: int32
                  type: integer
                queue:
                  type: string
                priorityClassName:
                  type: string
              type: object
            status:
              properties:
                succeeded:
                  format: int32
                  type: integer
                failed:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha1
    

    scheduling_v1alpha2_podgroup.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: podgroups.scheduling.sigs.dev
    spec:
      group: scheduling.sigs.dev
      names:
        kind: PodGroup
        plural: podgroups
      scope: Namespaced
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                minMember:
                  format: int32
                  type: integer
                queue:
                  type: string
                priorityClassName:
                  type: string
              type: object
            status:
              properties:
                succeeded:
                  format: int32
                  type: integer
                failed:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha2
    
    

    scheduling_v1alpha1_queue.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: queues.scheduling.incubator.k8s.io
      annotations:
        "helm.sh/hook": "crd-install"
    spec:
      group: scheduling.incubator.k8s.io
      names:
        kind: Queue
        plural: queues
      scope: Cluster
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                weight:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha1
    
    

    scheduling_v1alpha2_queue.yaml

    apiVersion: apiextensions.k8s.io/v1beta1
    kind: CustomResourceDefinition
    metadata:
      name: queues.scheduling.sigs.dev
    spec:
      group: scheduling.sigs.dev
      names:
        kind: Queue
        plural: queues
      scope: Cluster
      validation:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                weight:
                  format: int32
                  type: integer
              type: object
            status:
              properties:
                unknown:
                  format: int32
                  type: integer
                pending:
                  format: int32
                  type: integer
                running:
                  format: int32
                  type: integer
              type: object
          type: object
      version: v1alpha2
    
    

    【Step2】 创建deployment

    kubectl create -f deployment.yaml
    

    deployment.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kube-batch
      labels:
        chart: kube-batch-kube-batch
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: kube-batch
      template:
        metadata:
          labels:
            app: kube-batch
        spec:
          containers:
          - name: kube-batch
            image: 10.220.54.6:8088/kuai/kube-batch:v0.5
            args: ["--logtostderr", "--v", "3"]
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                cpu: 2000m
                memory: 2048Mi
              requests:
                cpu: 2000m
                memory: 2048Mi
    

    【Step3】创建Queue

    apiVersion: scheduling.incubator.k8s.io/v1alpha1
    kind: Queue
    metadata:
      name: default
    spec:
      weight: 1
    

    第二种:使用helm 安装方式

    【Step1】 下载kube-batch

    #mkdir -p $GOPATH/src/github.com/kubernetes-sigs/
    
    #cd $GOPATH/src/github.com/kubernetes-sigs/
    
    #git clone http://github.com/kubernetes-sigs/kube-batch
    
    

    【Step2】通过helm部署kube-batch

    #helm install $GOPATH/src/github.com/kubernetes-sigs/kube-batch/deployment/kube-batch --namespace kube-system
    

    【Step3】查看是否安装成功后

    #helm list
    
  • 相关阅读:
    代码混淆那些事
    Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流
    在Windows下搭建基于nginx的视频直播和点播系统
    windows下搭建基于nginx的rtmp服务器
    ijkplayer相关
    直播技术总结(三)ijkplayer的一些问题优化记录
    【.NET深呼吸】应用上下文(AppContext)
    【Win 10应用开发】自定义浮动层——Flyout
    【Win 10应用开发】AdaptiveTrigger在自定义控件中是可以触发的
    【.NET深呼吸】元组数据(Tuple)
  • 原文地址:https://www.cnblogs.com/shix0909/p/13280261.html
Copyright © 2011-2022 走看看