Skip to content

Commit

Permalink
Updated to use latest HCL config, fixing bug with interpolation, upda…
Browse files Browse the repository at this point in the history
…ted nomad and k8s images
  • Loading branch information
nicholasjackson committed Sep 24, 2024
1 parent faa7cfe commit 2c7efa2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ generate_mocks:

install_local:
go build -ldflags "-X main.version=${git_commit}" -gcflags=all="-N -l" -o bin/jumppad main.go
sudo mv /usr/local/bin/jumppad /usr/local/bin/jumppad-old || true
sudo cp bin/jumppad /usr/local/bin/jumppad
sudo mv /usr/bin/jumppad /usr/bin/jumppad-old || true
sudo cp bin/jumppad /usr/bin/jumppad

remove_local:
sudo mv /usr/bin/jumppad-old /usr/bin/jumppad || true
9 changes: 9 additions & 0 deletions examples/container/container.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ resource "container" "consul" {
memory = 1024
}

port {
local = 8507
remote = 8507
}

port_range {
range = "8500-8502"
enable_host = true
Expand Down Expand Up @@ -147,6 +152,10 @@ resource "sidecar" "envoy" {
name = "envoyproxy/envoy:v${variable.envoy_version}"
}

environment = {
PORT = "${resource.container.consul.port.0.local}"
}

command = ["tail", "-f", "/dev/null"]

volume {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/infinytum/raymond/v2 v2.0.5
github.com/jumppad-labs/connector v0.4.0
github.com/jumppad-labs/gohup v0.4.0
github.com/jumppad-labs/hclconfig v0.24.0
github.com/jumppad-labs/hclconfig v0.25.0
github.com/jumppad-labs/plugin-sdk v0.1.1-0.20240306185853-c09f71f81b8a
github.com/kennygrant/sanitize v1.2.4
github.com/mattn/go-isatty v0.0.20
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ github.com/jumppad-labs/gohup v0.4.0 h1:0OplHvnKnOLkqWm417sRHLSiJ4xGeb8LiSSAJ51Q
github.com/jumppad-labs/gohup v0.4.0/go.mod h1:JYvZnemxJlWDyx8RbDNcCBLZSvIrYlYLnkQqR1BKFW4=
github.com/jumppad-labs/hclconfig v0.24.0 h1:SyMCl2rwLC5o32CCp50fsVbJxyFFCiYoMejvfh9RJKM=
github.com/jumppad-labs/hclconfig v0.24.0/go.mod h1:AOzW0btnKiqUKYVi3ioGzSPNCWsTzsJxKcqzVORccvk=
github.com/jumppad-labs/hclconfig v0.25.0 h1:CRIprG+i+Ol9s2izb6PRrt23kyGYZ1OC/XGFqdI1o/M=
github.com/jumppad-labs/hclconfig v0.25.0/go.mod h1:AOzW0btnKiqUKYVi3ioGzSPNCWsTzsJxKcqzVORccvk=
github.com/jumppad-labs/log v0.0.0-20240827082827-4404884e31a7 h1:tuoFYWXAqT5BheDlQNumY1DxvkW8bjG9JOzoxpFneZs=
github.com/jumppad-labs/log v0.0.0-20240827082827-4404884e31a7/go.mod h1:S9jhxE2C1+jv2PlLTAow3h+ZILzvXRhd6eBjFAUcfgI=
github.com/jumppad-labs/plugin-sdk v0.1.1-0.20240306185853-c09f71f81b8a h1:fqPvAO1o/6bUIm0fwEbXcUzUCng+GDlLmSMT/5oUJUE=
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/resources/k8s/provider_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ func (p *ClusterProvider) createK3s(ctx context.Context) error {
"--kube-proxy-arg=conntrack-max-per-core=0",
disableArgs,
fmt.Sprintf("--snapshotter=%s", snapShotter),
fmt.Sprintf("--tls-san=%s", FQDN),
fmt.Sprintf("--tls-san=%s", FQDN), // add the FQDN for the server
fmt.Sprintf("--tls-san=%s", utils.GetDockerIP()), // add the docker host IP
clusterToken,
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/config/resources/k8s/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ type KubeConfig struct {
ClientKey string `hcl:"client_key" json:"client_key"` // base64 encoded client key
}

const k3sBaseImage = "shipyardrun/k3s"
const k3sBaseVersion = "v1.27.4"
const k3sBaseImage = "ghcr.io/jumppad-labs/kubernetes"
const k3sBaseVersion = "v1.31.1"

func (k *Cluster) Process() error {
if k.APIPort == 0 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/resources/nomad/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ type NomadCluster struct {
ExternalIP string `hcl:"external_ip,optional" json:"external_ip,omitempty"`
}

const nomadBaseImage = "shipyardrun/nomad"
const nomadBaseVersion = "1.7.5"
const nomadBaseImage = "ghcr.io/jumppad-labs/nomad"
const nomadBaseVersion = "v1.8.4"

type Config struct {
// Specifies configuration for the Docker driver.
Expand Down

0 comments on commit 2c7efa2

Please sign in to comment.