This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
/
modules.go
56 lines (53 loc) · 1.63 KB
/
modules.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package modules
import (
"context"
"fmt"
"github.com/rancher/rio/modules/autoscale"
"github.com/rancher/rio/modules/build"
"github.com/rancher/rio/modules/istio"
istio2 "github.com/rancher/rio/modules/istio/controllers/istio"
"github.com/rancher/rio/modules/monitoring"
"github.com/rancher/rio/modules/service"
"github.com/rancher/rio/modules/system"
"github.com/rancher/rio/pkg/constants"
"github.com/rancher/rio/pkg/stack"
"github.com/rancher/rio/types"
)
func Register(ctx context.Context, rioContext *types.Context) error {
if !constants.DisableIstio {
mesh := stack.NewSystemStack(rioContext.Apply, rioContext.Namespace, "mesh")
answer := map[string]string{
"HTTP_PORT": constants.DefaultHTTPOpenPort,
"HTTPS_PORT": constants.DefaultHTTPSOpenPort,
"TELEMETRY_ADDRESS": fmt.Sprintf("%s.%s.svc.cluster.local", constants.IstioTelemetry, rioContext.Namespace),
"NAMESPACE": rioContext.Namespace,
"TAG": "1.1.3",
"USE_HOSTPORT": fmt.Sprint(constants.UseHostPort),
}
if err := mesh.Deploy(answer); err != nil {
return err
}
if err := istio2.RegisterInjectors(ctx, rioContext); err != nil {
return err
}
}
if err := istio.Register(ctx, rioContext); err != nil {
return err
}
if err := system.Register(ctx, rioContext); err != nil {
return err
}
if err := service.Register(ctx, rioContext); err != nil {
return err
}
if err := monitoring.Register(ctx, rioContext); err != nil {
return err
}
if err := autoscale.Register(ctx, rioContext); err != nil {
return err
}
if err := build.Register(ctx, rioContext); err != nil {
return err
}
return nil
}