https://feichashao.com/kubectl-apply-fail/ | |
Root Cause | |
This is because there's a resourceVersion field in last-applied-configuration annotation, which is not expected. But why there's a resourceVersion field? | |
We can reproduce the issue like this: | |
## Create a CR using "kubectl apply" | |
$ cat origin.yml |
package main | |
import ( | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
"log" | |
"math/rand" | |
"net/http" | |
"time" |
Free TDD Tutorial
Go, Containers, and the Linux Scheduler
https://www.riverphillips.dev/blog/go-cfs/
GOMAXPROCS should be set to the number of CPU cores that the container is allowed to use, if you’re allocating fractional CPU round down, unless you’re allocating less than 1 CPU core in which case round up. GOMAXPROCS=max(1, floor(CPUs)) can be used to calculate the value. If you find it easier Uber has open sourced a library automaxprocs to calculate this value for you from your container’s cgroups automatically.
Kubebuilder does not exist as an example to copy-paste, but instead provides powerful libraries and tools to simplify building and publishing Kubernetes APIs from scratch. It provides a plugin architecture allowing users to take advantage of optional helpers and features.
Kubebuilder is developed on top of the controller-runtime and controller-tools libraries.
Kubebuilder is extensible and can be used as a library in other projects. Operator-SDK is a good example of a project that uses Kubebuilder as a library.
Sample controller: https://github.com/kubernetes/sample-controller
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"io/ioutil" | |
"log" | |
"net" | |
"os" | |
"os/signal" |
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
"os" | |
"sync" | |
) |
http://checkip.amazonaws.com/ |
https://serverfault.com/questions/1010342/nginx-using-resolver-in-a-stream
stream {
resolver 127.0.0.1 valid=1s;
# a hack to declare $server_us variable
map "" $server_us {
default server.foo.com:22222;