Skip to content

Commit

Permalink
using manual command for rke2 service restarts (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Kumar <[email protected]>
  • Loading branch information
kpiyush17 committed Feb 20, 2024
1 parent dc650e1 commit 0b5b6c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BUILD_GOLANG:
RUN assert-fips.sh ${BIN}
RUN assert-static.sh ${BIN}
ELSE
RUN go-build.sh -a -o ${BIN} ./${SRC}
RUN go-build-static.sh -a -o ${BIN} ./${SRC}
END

SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}
Expand Down
16 changes: 6 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (

serverSystemName = "rke2-server"
agentSystemName = "rke2-agent"
K8S_NO_PROXY = ".svc,.svc.cluster,.svc.cluster.local"
K8SNoProxy = ".svc,.svc.cluster,.svc.cluster.local"
localImagesPath = "/opt/content/images"
)

Expand Down Expand Up @@ -89,7 +89,7 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig {

stages := []yip.Stage{
{
Name: " Install RKE2 Configuration Files",
Name: "Install RKE2 Configuration Files",
Files: files,

Commands: []string{
Expand Down Expand Up @@ -121,13 +121,9 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig {
},
yip.Stage{
Name: "Enable Systemd Services",
Systemctl: yip.Systemctl{
Enable: []string{
systemName,
},
Start: []string{
systemName,
},
Commands: []string{
fmt.Sprintf("systemctl enable %s", systemName),
fmt.Sprintf("systemctl restart %s", systemName),
},
})

Expand Down Expand Up @@ -199,7 +195,7 @@ func getDefaultNoProxy(userOptions []byte) string {
if len(serviceCIDR) > 0 {
noProxy = noProxy + "," + serviceCIDR
}
noProxy = noProxy + "," + getNodeCIDR() + "," + K8S_NO_PROXY
noProxy = noProxy + "," + getNodeCIDR() + "," + K8SNoProxy
}

return noProxy
Expand Down

0 comments on commit 0b5b6c2

Please sign in to comment.