Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
417be379
Commit
417be379
authored
1 year ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Add the documented -info flag and improve related docs
parent
7ed4dae9
No related branches found
No related tags found
No related merge requests found
Pipeline
#28857
passed
1 year ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+6
-6
6 additions, 6 deletions
README.md
cmd/hepto/config.go
+3
-0
3 additions, 0 deletions
cmd/hepto/config.go
cmd/hepto/hepto.go
+16
-1
16 additions, 1 deletion
cmd/hepto/hepto.go
with
25 additions
and
7 deletions
README.md
+
6
−
6
View file @
417be379
...
...
@@ -41,7 +41,7 @@ To start your first cluster, run `hepto` in `full` mode, which embeds both a
master (apiserver, controller manager, etc.) and a kubelet in a single process.
```
source env
source
docs/example.
env
hepto \
# The node name, data will be stored in /var/lib/mycluster/mymaster
-name myfull \
...
...
@@ -77,14 +77,14 @@ required when bootstraping nodes).
Start by running a master node anywhere:
```
source .
/
env
source
docs/example
.env
hepto -name mymaster -role master -iface eth0 -ip 2a00::dead:beef/64
```
Then on every other node, use the anchor IP address for discovery:
```
source .
/
env
source
docs/example
.env
hepto -name mynode1 -role node -iface eth0 -anchor 2a00::dead:beef
```
...
...
@@ -103,8 +103,8 @@ In order to display hepto network configuration, which is useful for later setti
the CNI and service proxy:
```
source env
hepto -name whatever -info
source
docs/example.
env
hepto
-iface eth0
-name whatever -info
```
### Deploying Calico
...
...
@@ -229,7 +229,7 @@ Start by cloning the repository, then build the project:
```
# Some build configuration is declared as environmemt variables
source env
source
docs/example.
env
# Build a single binary
go build -tags "$TAGS" -ldflags "$LDFLAGS" ./cmd/hepto.go
```
...
...
This diff is collapsed.
Click to expand it.
cmd/hepto/config.go
+
3
−
0
View file @
417be379
...
...
@@ -16,6 +16,8 @@ import (
// General configuration, used for parsing flags
type
Config
struct
{
// Should we display info and exit
Info
bool
// Should we fork and daemonize
Daemonize
bool
// Data is stored under this base folder, a subfolder
...
...
@@ -46,6 +48,7 @@ func (c *Config) FlagSet() *flag.FlagSet {
// General config
fs
.
IntVar
(
&
config
.
LogLevel
,
"verbose"
,
0
,
"Make logs more verbose"
)
fs
.
BoolVar
(
&
config
.
Daemonize
,
"daemonize"
,
false
,
"Daemonize the subprocess"
)
fs
.
BoolVar
(
&
config
.
Info
,
"info"
,
false
,
"Display cluster info and exit"
)
fs
.
BoolVar
(
&
config
.
Pprof
,
"pprof"
,
false
,
"Enable Golang profiling"
)
fs
.
StringVar
(
&
config
.
DataDir
,
"data"
,
"/var/lib"
,
"Data base directory"
)
// Cluster settings
...
...
This diff is collapsed.
Click to expand it.
cmd/hepto/hepto.go
+
16
−
1
View file @
417be379
...
...
@@ -7,6 +7,7 @@ import (
"os"
"path"
"strings"
"text/tabwriter"
"go.acides.org/dolly"
"go.acides.org/hepto/services"
...
...
@@ -35,7 +36,21 @@ func Hepto() error {
config
.
Cluster
.
DataDir
=
"/data"
config
.
Iface
.
ReadinessProbe
=
netip
.
AddrPortFrom
(
config
.
Network
.
DNS
[
0
],
53
)
manager
:=
services
.
NewManager
(
&
config
.
Cluster
,
&
config
.
Node
,
config
.
Logger
)
// Create a container and start the manager
// If displaying info was required, go for it
if
config
.
Info
{
w
:=
tabwriter
.
NewWriter
(
os
.
Stdout
,
2
,
3
,
1
,
' '
,
0
)
fmt
.
Fprintf
(
w
,
"cluster name
\t
%s
\n
"
,
config
.
Cluster
.
Name
)
fmt
.
Fprintf
(
w
,
"cluster vpn CIDR
\t
%s
\n
"
,
manager
.
State
.
Networking
()
.
NodeNet
)
fmt
.
Fprintf
(
w
,
"cluster pod CIDR
\t
%s
\n
"
,
manager
.
State
.
Networking
()
.
PodNet
)
fmt
.
Fprintf
(
w
,
"cluster service CIDR
\t
%s
\n
"
,
manager
.
State
.
Networking
()
.
ServiceNet
)
fmt
.
Fprintf
(
w
,
"node name
\t
%s
\n
"
,
config
.
Node
.
Name
)
fmt
.
Fprintf
(
w
,
"node role
\t
%s
\n
"
,
config
.
Node
.
Role
)
fmt
.
Fprintf
(
w
,
"node vpn IP
\t
%s
\n
"
,
manager
.
State
.
Networking
()
.
NodeAddress
)
fmt
.
Fprintf
(
w
,
"node data
\t
%s
\n
"
,
dataPath
)
fmt
.
Fprintf
(
w
,
"apiserver IP
\t
%s
\n
"
,
manager
.
State
.
Networking
()
.
APIAddress
)
return
w
.
Flush
()
}
// Otherwise create a container and start the manager
c
:=
dolly
.
NewForking
(
!
config
.
Daemonize
)
c
.
AddAll
(
dolly
.
NewContainer
(
config
.
Node
.
Name
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment