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 6c505f2 commit 22bd763
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
56 changes: 28 additions & 28 deletions common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,49 +155,49 @@ ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s \
{{if .TypeMaster -}}
{{- 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 .DataStore -}}
--datastore-endpoint {{ .DataStore }} \
{{else -}}
{{- if .PodCIDR }}
--cluster-cidr {{ .PodCIDR }} \
{{- end -}}
{{- if .ServiceCIDR }}
--service-cidr {{ .ServiceCIDR }} \
{{- end -}}
{{- if .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 \
{{end -}}
{{if .LocalStorage -}}
--disable servicelb,traefik \
--server https://{{ .KubeAPI }}:6443 \
{{ end -}}
--cluster-init \
--etcd-expose-metrics \
--etcd-snapshot-name auto-snapshot \
--etcd-snapshot-compress \
{{- end -}}
{{- if .LocalStorage }}
--disable servicelb,traefik \
{{else -}}
--disable servicelb,traefik,local-storage \
{{end -}}
--disable servicelb,traefik,local-storage \
{{- end -}}
--disable-cloud-controller \
--system-default-registry {{ .Registry }} \
--disable-network-policy \
--disable-helm-controller \
{{if .CNI -}}
--flannel-backend {{ .CNI }} \
{{if .CNI }}
--flannel-backend {{ .CNI }} \
{{end -}}
{{else -}}
--server https://{{ .KubeAPI }}:6443 \
{{- else}}
agent \
{{end -}}
--server https://{{ .KubeAPI }}:6443 \
{{- end }}
--token {{ .KubeToken }} \
--data-dir {{.DataDir}} \
--docker \
--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"
--kube-proxy-arg "metrics-bind-address=0.0.0.0" \
--docker
`
3 changes: 2 additions & 1 deletion internal/pkg/cli/k3stpl/k3stpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package k3stpl

import (
"bytes"
"html/template"
"os"
"text/template"

"github.com/ergoapi/util/exnet"
"github.com/ergoapi/util/file"
Expand Down Expand Up @@ -94,5 +94,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")
return rootCmd
}

0 comments on commit 22bd763

Please sign in to comment.