Skip to content

Commit

Permalink
* [fix] fix typo systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Sep 18, 2024
1 parent b1d223b commit 6a6b16f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
58 changes: 32 additions & 26 deletions common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,37 +157,43 @@ ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s \
{{- if .TypeMaster}}
server \
--tls-san kubeapi.corp.cc \
--tls-san apiserver.cluster.local \
--tls-san {{ .KubeAPI }} \
{{if .PodCIDR }}--cluster-cidr {{ .PodCIDR }} \ {{end}}
{{if .ServiceCIDR }}--service-cidr {{ .ServiceCIDR }} \ {{end}}
{{if .CNI }}--flannel-backend {{ .CNI }} \ {{ end }}
--tls-san kubeapi.corp.cc \
--tls-san apiserver.cluster.local \
--tls-san {{ .KubeAPI }} \
{{if .PodCIDR }}
--cluster-cidr {{ .PodCIDR }} \
{{end}}
{{if .ServiceCIDR }}
--service-cidr {{ .ServiceCIDR }} \
{{end}}
{{if .CNI }}
--flannel-backend {{ .CNI }} \
{{ end }}
{{- if .DataStore }}
--datastore-endpoint {{ .DataStore }} \
--datastore-endpoint {{ .DataStore }} \
{{- else}}
{{if not .Master0 -}}
--server https://{{ .KubeAPI }}:6443 \
{{ end -}}
--cluster-init \
--etcd-expose-metrics \
--etcd-snapshot-name auto-snapshot \
--etcd-snapshot-compress \
--server https://{{ .KubeAPI }}:6443 \
{{ end }}
--cluster-init \
--etcd-expose-metrics \
--etcd-snapshot-name auto-snapshot \
--etcd-snapshot-compress \
{{- end}}
--disable-cloud-controller \
--system-default-registry {{ .Registry }} \
--disable-network-policy \
--disable-helm-controller \
{{if .LocalStorage }}--disable servicelb,traefik \ {{- else }}--disable servicelb,traefik,local-storage \ {{- end }}
--disable-cloud-controller \
--system-default-registry {{ .Registry }} \
--disable-network-policy \
--disable-helm-controller \
--disable servicelb,traefik,local-storage \
{{- else}}
agent \
--server https://{{ .KubeAPI }}:6443 \
--server https://{{ .KubeAPI }}:6443 \
{{- end }}
--token {{ .KubeToken }} \
--data-dir {{.DataDir}} \
--pause-image {{ .Registry }}/rancher/mirrored-pause:3.6 \
--prefer-bundled-bin \
--kube-proxy-arg "proxy-mode=ipvs" "masquerade-all=true" \
--kube-proxy-arg "metrics-bind-address=0.0.0.0" \
--docker
--token {{ .KubeToken }} \
--data-dir {{.DataDir}} \
--pause-image {{ .Registry }}/rancher/mirrored-pause:3.6 \
--prefer-bundled-bin \
--kube-proxy-arg "proxy-mode=ipvs" "masquerade-all=true" \
--kube-proxy-arg "metrics-bind-address=0.0.0.0" \
--docker
`
1 change: 1 addition & 0 deletions hack/manifests/scripts/cleankube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ datadir=$(cat /root/.qc/config/cluster.yaml | grep datadir | awk '{print $2}')
[ ! -z "$datadir" ] && rm -rf $datadir

[ -d "/etc/rancher/k3s" ] && rm -rf /etc/rancher/k3s
[ -d "/etc/rancher/node" ] && rm -rf /etc/rancher/node
[ -d "/run/k3s" ] && rm -rf /run/k3s
[ -d "/run/flannel" ] && rm -rf /run/flannel
[ -d "/var/lib/rancher/k3s" ] && rm -rf /var/lib/rancher/k3s
Expand Down
1 change: 1 addition & 0 deletions hack/manifests/scripts/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ check_docker() {
which_cmd=$(command -v docker 2>/dev/null || true)
if [ -z "${which_cmd}" ]; then
sed -i "s#--docker \\\##g" /root/.k3s.service
sed -i "s#--docker##g" /root/.k3s.service
fi
}

Expand Down
1 change: 0 additions & 1 deletion internal/pkg/cli/k3stpl/k3stpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func EmbedCommand(f factory.Factory) *cobra.Command {
rootCmd.Flags().BoolVar(&k3sargs.LocalStorage, "local-storage", true, "local-storage")
rootCmd.Flags().StringVar(&k3sargs.Master0IP, "master0ip", "", "master0ip, only work offline mode")
rootCmd.Flags().StringVar(&k3sargs.Registry, "registry", "hub.zentao.net", "registry")
rootCmd.Flags().StringVar(&k3sargs.DataStore, "datasource", "", "datasource")
rootCmd.Flags().StringVar(&k3sargs.CNI, "cni", "", "cni")
return rootCmd
}

0 comments on commit 6a6b16f

Please sign in to comment.