Kubernetes Developement

资源模板 statefulset举例 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 apiVersion:apps/v1beta1kind:StatefulSetmetadata:name:kubiaspec:serviceName:kubiareplicas:2template:metadata:labels:app:kubiaspec:containers:- name:kubiaimage:derios/kubiaports:- name:httpcontainerPort:8080volumeMounts:- name:datamountPath:/var/datavolumeClaimTemplates:- metadata:name:dataspec:resources:requests:storage:1MiaccessModes:- ReadWriteOnce headless service举例 1 2 3 4 5 6

LC刷题: 字符串专题

14. Longest Common Prefix 返回最长公共前缀子串。原题 1 2 Input: ["flower","flow","flight"] Output: "fl" 水平扫描: 从头开始遍历整个数组,并且两两比较LCP。如果第i次比较的结果是空,则停止迭代返回空

Profiling a Go Service in Production

参考 Julia Evans: Profiling Go programs with pprof How I investigated memory leaks in Go using pprof on a large codebase Memory Profiling a Go Service Russ Cox: Profling Go Programs Package pprof overview github: pprof Issue: Why ‘Total MB’ in golang heap profile is less than ‘RES’ in top? Issue: Cannot free memory once occupied by bytes.Buffer Issue: FreeOSMemory() in production Issue: Is this an idiomatic worker thread