mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
Rename to hauler
This commit is contained in:
22
README.md
22
README.md
@@ -1,10 +1,10 @@
|
||||
# k3ama - Air-gap Migration Assistant (working name)
|
||||
# Hauler - Kubernetes Air Gap Migration
|
||||
```bash
|
||||
# _ _____ _ __ __ _
|
||||
# | | _|___ / / \ | \/ | / \
|
||||
# | |/ / |_ \ / _ \ | |\/| | / _ \
|
||||
# | < ___) / ___ \| | | |/ ___ \
|
||||
# |_|\_\____/_/ \_\_| |_/_/ \_\ k3s- Air-gap Migration Assistant
|
||||
# _ _
|
||||
# | |__ __ _ _ _| | ___ _ __
|
||||
# | '_ \ / _` | | | | |/ _ \ '__|
|
||||
# | | | | (_| | |_| | | __/ |
|
||||
# |_| |_|\__,_|\__,_|_|\___|_|
|
||||
#
|
||||
# , , _______________________________
|
||||
# ,-----------|'------'| | |
|
||||
@@ -59,7 +59,7 @@ WARNING- Work In Progress
|
||||
A Vagrantfile is provided to allow easy provisioning of a local air-gapped CentOS environment. Some
|
||||
artifacts need to be collected from the internet, however; below are the steps required for
|
||||
successfully provisioning this machine, downloading all dependencies, and installing k3s (without
|
||||
k3ama) into this machine.
|
||||
hauler) into this machine.
|
||||
|
||||
### First-time setup
|
||||
|
||||
@@ -110,23 +110,23 @@ repository under `local-artifacts`.
|
||||
|
||||
## Go CLI
|
||||
|
||||
The initial MVP for a k3ama CLI used to streamline the packaging and deploying processes is in the
|
||||
The initial MVP for a hauler CLI used to streamline the packaging and deploying processes is in the
|
||||
`cmd/` and `pkg/` folders, along with `go.mod` and `go.sum`. Currently only a `package` subcommand
|
||||
is supported, which generates a `.tar.gz` archive used in the future `deploy` subcommand.
|
||||
|
||||
### Build
|
||||
|
||||
To build k3ama, the Go CLI v1.14 or higher is required. See <https://golang.org/dl/> for downloads
|
||||
To build hauler, the Go CLI v1.14 or higher is required. See <https://golang.org/dl/> for downloads
|
||||
and see <https://golang.org/doc/install> for installation instructions.
|
||||
|
||||
To build k3ama for your local machine (usually for the `package` step), run the following:
|
||||
To build hauler for your local machine (usually for the `package` step), run the following:
|
||||
|
||||
```bash
|
||||
mkdir bin
|
||||
go build -o bin ./cmd/...
|
||||
```
|
||||
|
||||
To build k3ama for linux amd64 (required for the `deploy` step in an air-gapped environment), run
|
||||
To build hauler for linux amd64 (required for the `deploy` step in an air-gapped environment), run
|
||||
the following:
|
||||
|
||||
```bash
|
||||
|
||||
4
Vagrantfile
vendored
4
Vagrantfile
vendored
@@ -9,14 +9,14 @@ Vagrant.configure("2") do |config|
|
||||
config.vm.hostname = "airgap"
|
||||
config.vm.network "private_network", type: "dhcp"
|
||||
|
||||
config.vm.synced_folder ".", "/opt/k3ama"
|
||||
config.vm.synced_folder ".", "/opt/hauler"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "2048"
|
||||
vb.cpus = "2"
|
||||
|
||||
config.vm.provision "airgap", type: "shell", run: "always",
|
||||
inline: "/opt/k3ama/vagrant-scripts/airgap.sh airgap"
|
||||
inline: "/opt/hauler/vagrant-scripts/airgap.sh airgap"
|
||||
end
|
||||
|
||||
# SELinux is Enforcing by default.
|
||||
|
||||
@@ -8,10 +8,10 @@ func NewDeployCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "deploy",
|
||||
Short: "deploy all dependencies from a generated package",
|
||||
Long: `deploy a k3s cluster serving all dependencies in a generated package.
|
||||
Long: `deploy all dependencies in a generated package.
|
||||
|
||||
Given the package archive generated from package, deploy the k3s cluster used to serve all packaged
|
||||
dependencies.`,
|
||||
Given the package archive generated from the package command, deploy all needed
|
||||
components to serve all packaged dependencies.`,
|
||||
}
|
||||
|
||||
return cmd
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/rancherfederal/k3ama/pkg/packager"
|
||||
"github.com/rancherfederal/hauler/pkg/packager"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -31,7 +31,10 @@ Container images, git repositories, and more, packaged and ready to be served wi
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().StringVar(&opts.OutputFileName, "out-file", "k3ama-package.tar.gz", "specify the package's output location; - writes to standard out")
|
||||
cmd.Flags().StringVar(
|
||||
&opts.OutputFileName, "out-file", "hauler-package.tar.gz",
|
||||
"specify the package's output location; '-' writes to standard out",
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
23
cmd/hauler/app/root.go
Normal file
23
cmd/hauler/app/root.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewRootCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "hauler",
|
||||
Short: "hauler provides airgap migration assitance",
|
||||
Long: `hauler provides airgap migration assistance using k3s.
|
||||
|
||||
Choose your functionality and create a package when internet access is available,
|
||||
then deploy the package into your air-gapped environment.`,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
cmd.AddCommand(NewPackageCommand())
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/rancherfederal/k3ama/cmd/k3ama/app"
|
||||
"github.com/rancherfederal/hauler/cmd/hauler/app"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -1,23 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewRootCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "k3ama",
|
||||
Short: "k3ama provides airgap migration assitance",
|
||||
Long: `k3ama provides airgap migration assistance using k3s.
|
||||
|
||||
Choose your functionality and create a package with internet access, then deploy the package into
|
||||
your air-gapped environment.`,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
cmd.AddCommand(NewPackageCommand())
|
||||
|
||||
return cmd
|
||||
}
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module github.com/rancherfederal/k3ama
|
||||
module github.com/rancherfederal/hauler
|
||||
|
||||
go 1.14
|
||||
|
||||
|
||||
@@ -37,11 +37,15 @@ cp ${ARTIFACT_DIR}/images/* ${LOCAL_IMAGES_FILEPATH}
|
||||
|
||||
if [ -n "${LOCAL_RKE2_BIN}" ] && [ -f "${ARTIFACT_DIR}/bin/${LOCAL_RKE2_BIN}" ] ; then
|
||||
echo "Use "${ARTIFACT_DIR}/bin/${LOCAL_RKE2_BIN}" for rke2 binary"
|
||||
|
||||
INSTALL_RKE2_SKIP_START=true \
|
||||
RKE2_RUNTIME_IMAGE="rancher/rke2-runtime:${RKE2_VERSION_DOCKER}" \
|
||||
${ARTIFACT_DIR}/bin/rke2-installer.run
|
||||
|
||||
rm -f /usr/local/bin/rke2
|
||||
|
||||
cp "${ARTIFACT_DIR}/bin/${LOCAL_RKE2_BIN}" /usr/local/bin/rke2
|
||||
|
||||
systemctl start rke2
|
||||
else
|
||||
${ARTIFACT_DIR}/bin/rke2-installer.run
|
||||
|
||||
Reference in New Issue
Block a user