Skip to content

Commit c32e218

Browse files
committed
[public-api] Add k8s service definition
1 parent 583ff4e commit c32e218

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

install/installer/pkg/components/public-api-server/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ package public_api_server
77
const (
88
Component = "public-api-server"
99
ContainerPort = 9000
10+
ServicePort = 9000
1011
PortName = "http"
1112
)

install/installer/pkg/components/public-api-server/objects.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func Objects(ctx *common.RenderContext) ([]runtime.Object, error) {
2121
deployment,
2222
rolebinding,
2323
common.DefaultServiceAccount(Component),
24+
service,
2425
)(ctx)
2526
}
2627

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package public_api_server
2+
3+
import (
4+
"github.com/gitpod-io/gitpod/installer/pkg/common"
5+
"k8s.io/apimachinery/pkg/runtime"
6+
)
7+
8+
func service(ctx *common.RenderContext) ([]runtime.Object, error) {
9+
if cfg := getExperimentalPublicAPIConfig(ctx); cfg == nil {
10+
return nil, nil
11+
}
12+
13+
return common.GenerateService(Component, map[string]common.ServicePort{
14+
PortName: {
15+
ContainerPort: ContainerPort,
16+
ServicePort: ServicePort,
17+
},
18+
})(ctx)
19+
}

0 commit comments

Comments
 (0)