// 在实例化一个变量之前,可以传入函数作用于它。pilot中的addFlags函数使用了类似“过滤器”的做法:
// NewPilotArgs constructs pilotArgs with default values.
func NewPilotArgs(initFuncs ...func(*PilotArgs)) *PilotArgs {
p := &PilotArgs{}
// Apply Default Values.
p.applyDefaults()
// Apply custom initialization functions.
#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install K3S | |
curl -sfL https://get.k3s.io | sh - | |
# Copy k3s config | |
mkdir $HOME/.kube | |
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config | |
sudo chmod 644 $HOME/.kube/config | |
# Check K3S | |
kubectl get pods -n kube-system |