Skip to content

Commit a00a23e

Browse files
committed
Merge remote-tracking branch 'origin/main' into ash/restorecon
2 parents d805f95 + fcf01cc commit a00a23e

File tree

186 files changed

+6568
-2755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+6568
-2755
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,24 @@ create-node%: DISTRO = debian-bookworm
343343
create-node%: NODE_PORT = 30000
344344
create-node%: MANAGER_NODE_PORT = 30080
345345
create-node%: K0S_DATA_DIR = /var/lib/embedded-cluster/k0s
346+
create-node%: K0S_DATA_DIR_V3 = $(shell \
347+
if [ -n "$(REPLICATED_APP)" ]; then \
348+
echo "/var/lib/$(shell echo '$(REPLICATED_APP)' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g')/k0s"; \
349+
else \
350+
echo "/var/lib/embedded-cluster-smoke-test-staging-app/k0s"; \
351+
fi)
346352
create-node%: ENABLE_V3 = 0
347353
create-node%:
354+
@echo "Mounting data directories:"
355+
@echo " v2: $(K0S_DATA_DIR)"
356+
@echo " v3: $(K0S_DATA_DIR_V3)"
348357
@docker run -d \
349358
--name node$* \
350359
--hostname node$* \
351360
--privileged \
352361
--restart=unless-stopped \
353362
-v $(K0S_DATA_DIR) \
363+
-v $(K0S_DATA_DIR_V3) \
354364
-v $(shell pwd):/replicatedhq/embedded-cluster \
355365
-v $(shell dirname $(shell pwd))/kots:/replicatedhq/kots \
356366
$(if $(filter node0,node$*),-p $(NODE_PORT):$(NODE_PORT)) \

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ Additionally, it includes a Registry when deployed in air gap mode, and SeaweedF
9191
make list-distros
9292
```
9393
94+
**Note:** The development environment automatically mounts both data directories to support v2 and v3:
95+
- **v2 mode:** Uses `/var/lib/embedded-cluster/k0s`
96+
- **v3 mode:** Uses `/var/lib/{app-slug}/k0s` (determined from `REPLICATED_APP`)
97+
98+
Both directories are mounted automatically, so the embedded cluster binary can use whichever one it needs without any manual configuration.
99+
94100
1. In the Vendor Portal, create and download a license that is assigned to the channel.
95101
We recommend storing this license in the `local-dev/` directory, as it is gitignored and not otherwise used by the CI.
96102

api/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ Provides a client library for interacting with the API. The client package imple
9393
- This design choice enables better testability and easier iteration in the development environment
9494
- API components should be independently configurable and testable
9595

96+
2. **Kubernetes as a Subset of Linux**:
97+
- The Kubernetes installation target should be a subset of the Linux installation target
98+
- Linux installations include Kubernetes cluster setup (k0s, addons) plus application management
99+
- Kubernetes installations focus on application management (deployment, upgrades, lifecycle) on an existing Kubernetes cluster
100+
- Once Linux installation finishes setting up the Kubernetes cluster, subsequent operations should follow the same workflow as Kubernetes installations
101+
96102
## Integration
97103

98104
The API package is designed to be used as part of the larger Embedded Cluster system. It provides both HTTP endpoints for external access and a client library for internal use.

api/api.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/replicatedhq/embedded-cluster/api/controllers/auth"
77
"github.com/replicatedhq/embedded-cluster/api/controllers/console"
8+
kubernetesinstall "github.com/replicatedhq/embedded-cluster/api/controllers/kubernetes/install"
89
linuxinstall "github.com/replicatedhq/embedded-cluster/api/controllers/linux/install"
910
"github.com/replicatedhq/embedded-cluster/api/pkg/logger"
1011
"github.com/replicatedhq/embedded-cluster/api/types"
@@ -39,9 +40,10 @@ type API struct {
3940
logger logrus.FieldLogger
4041
metricsReporter metrics.ReporterInterface
4142

42-
authController auth.Controller
43-
consoleController console.Controller
44-
linuxInstallController linuxinstall.Controller
43+
authController auth.Controller
44+
consoleController console.Controller
45+
linuxInstallController linuxinstall.Controller
46+
kubernetesInstallController kubernetesinstall.Controller
4547

4648
handlers handlers
4749
}
@@ -70,6 +72,13 @@ func WithLinuxInstallController(linuxInstallController linuxinstall.Controller)
7072
}
7173
}
7274

75+
// WithKubernetesInstallController configures the kubernetes install controller for the API.
76+
func WithKubernetesInstallController(kubernetesInstallController kubernetesinstall.Controller) Option {
77+
return func(a *API) {
78+
a.kubernetesInstallController = kubernetesInstallController
79+
}
80+
}
81+
7382
// WithLogger configures the logger for the API. If not provided, a default logger will be created.
7483
func WithLogger(logger logrus.FieldLogger) Option {
7584
return func(a *API) {

api/client/client.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ import (
1111

1212
type Client interface {
1313
Authenticate(password string) error
14-
GetInstallationConfig() (types.InstallationConfig, error)
15-
GetInstallationStatus() (types.Status, error)
16-
ConfigureInstallation(config types.InstallationConfig) (types.Status, error)
17-
SetupInfra() (types.Infra, error)
18-
GetInfraStatus() (types.Infra, error)
19-
SetInstallStatus(status types.Status) (types.Status, error)
14+
GetLinuxInstallationConfig() (types.LinuxInstallationConfig, error)
15+
GetLinuxInstallationStatus() (types.Status, error)
16+
ConfigureLinuxInstallation(config types.LinuxInstallationConfig) (types.Status, error)
17+
SetupLinuxInfra() (types.LinuxInfra, error)
18+
GetLinuxInfraStatus() (types.LinuxInfra, error)
19+
20+
GetKubernetesInstallationConfig() (types.KubernetesInstallationConfig, error)
21+
ConfigureKubernetesInstallation(config types.KubernetesInstallationConfig) (types.Status, error)
22+
GetKubernetesInstallationStatus() (types.Status, error)
2023
}
2124

2225
type client struct {

0 commit comments

Comments
 (0)