Author: jpuyy

  • kubernetes kafka-client

    镜像使用 https://hub.docker.com/r/confluentinc/cp-kafka/

    kubectl apply -f kafka-client.yaml

    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kafka-client
      namespace: app
    spec:
      selector:
        matchLabels:
          app: kafka-client
      template:
        metadata:
          labels:
            app: kafka-client
        spec:
          containers:
            - name: kafka-client
              image: confluentinc/cp-kafka
              imagePullPolicy: IfNotPresent
              command: ["sleep"]
              args: ["infinity"]
    

    长时间跑在 front 或者使用

            command:
              - sh
              - -c
              - "exec tail -f /dev/null"
    
  • badblocks check disk

    家里的 linux 用了好长时间了,运行一下

    badblocks -v /dev/sda1 > /tmp/sda1-badsectors.txt
    Checking blocks 0 to 3907016703
    Checking for bad blocks (read-only test): 
    
  • git 查看具体一次 commit 改动的文件

    方法一:

    git --no-pager log -n 1 --name-only ${COMMIT_SHA} 
    

    方法二:

    git --no-pager show --stat=1000,800 ${COMMIT_SHA}
    
  • intellij settings shortcuts

    快速打开 project

    https://www.jetbrains.com/help/webstorm/opening-reopening-and-closing-projects.html#ws_reopen_project_with_run_anything

    格式化代码

    https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html

    显示空格

    Show whitespaces
    https://www.jetbrains.com/help/idea/settings-editor-appearance.html

    取消烦人的升级提示

    automatically check for plugin updates

    设置关闭 project, Keymap, Main menu, File, Close Project

    command + shift + w

    https://stackoverflow.com/questions/32765340/is-there-a-shortcut-to-close-a-project-in-intellij

  • helm

    helm 2

    版本

    helm version
    

    安装或升级

    helm upgrade gitlab-runner gitlab/gitlab-runner --namespace tools -f deploy/gitlab-runner-values.yaml --install --wait

    查看

    helm status gitlab-runner
    

    Init

    helm init --client-only

    Dry run, upgrade, deployment pods will rolling update

    helm upgrade --dry-run --debug -f values.yaml gitlab-runner .

    istio

    helm upgrade --dry-run --debug -f values.yaml istio .
    

    清理

    helm delete gitlab-runner --purge

    查看,更新 repo

    helm repo list
    helm repo update
    

    查看 repo 下的所有版本

    helm2 search -l gitlab/gitlab-runner
    helm2 search -l stable/nginx-ingress
    

    安装具体 chart 版本

    helm upgrade --debug gitlab-runner gitlab/gitlab-runner --version "1.8.1" --namespace infra gitlab-runner-values.yaml --install --wait
    
    helm --kube-context prod list
    

    切换 helm 版本

    brew unlink kubernetes-helm
    brew switch helm 3.4.0
    

    查看一个 helm 所有资源

    helm2 get service1
    helm3 get all service1 -n dev
    

    查看 values

    helm3.6.1 get values gitlab-runner  -n infra