@@ -20,13 +20,6 @@ import (
2020 corev1 "k8s.io/api/core/v1"
2121 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222 "k8s.io/apimachinery/pkg/runtime"
23- "sigs.k8s.io/yaml"
24- )
25-
26- const (
27- defaultHTTPPort = 8080
28- defaultGRPCPort = 50051
29- defaultMetricsPort = 9000
3023)
3124
3225type Image struct {
@@ -62,23 +55,17 @@ type IngressConfig struct {
6255 Annotations map [string ]string `json:"annotations,omitempty"`
6356 // The type of ingress that is used
6457 IngressClass string `json:"ingressClass,omitempty"`
65- // Overide name for ingress
66- NameOverride string `json:"nameOverride,omitempty"`
58+ // An array of host names to build ingress rules for
59+ Hostnames []string `json:"hostNames,omitempty"`
60+ // Who is issuing certificates for CA
61+ ClusterIssuer string `json:"clusterIssuer,omitempty"`
6762}
6863
6964type AdditionalClusterRoleBinding struct {
7065 NameSuffix string `json:"nameSuffix"`
7166 ClusterRoleName string `json:"clusterRoleName"`
7267}
7368
74- type PortConfig struct {
75- HttpPort int32 `json:"httpPort"`
76- HttpNodePort int32 `json:"httpNodePort,omitempty"`
77- GrpcPort int32 `json:"grpcPort"`
78- GrpcNodePort int32 `json:"grpcNodePort,omitempty"`
79- MetricsPort int32 `json:"metricsPort"`
80- }
81-
8269// CommonSpecBase is the common configuration for all services.
8370// NOTE(Clif): You must label this with `json:""` when using it as an embedded
8471// struct in order for controller-gen to use the promoted fields as expected.
@@ -109,37 +96,6 @@ type CommonSpecBase struct {
10996 AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`
11097 // Additional volume mounts that are added as volumes
11198 AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
112- // PortConfig is automatically populated with defaults and overlaid by values in ApplicationConfig.
113- PortConfig PortConfig `json:"portConfig,omitempty"`
114- }
115-
116- // BuildPortConfig extracts ports from the ApplicationConfig and returns a PortConfig
117- func BuildPortConfig (rawAppConfig runtime.RawExtension ) (PortConfig , error ) {
118- appConfig , err := ConvertRawExtensionToYaml (rawAppConfig )
119- if err != nil {
120- return PortConfig {}, err
121- }
122- // defaults
123- portConfig := PortConfig {
124- HttpPort : defaultHTTPPort ,
125- GrpcPort : defaultGRPCPort ,
126- MetricsPort : defaultMetricsPort ,
127- }
128- err = yaml .Unmarshal ([]byte (appConfig ), & portConfig )
129- if err != nil {
130- return PortConfig {}, err
131- }
132- return portConfig , nil
133- }
134-
135- // ConvertRawExtensionToYaml converts a RawExtension input to Yaml
136- func ConvertRawExtensionToYaml (config runtime.RawExtension ) (string , error ) {
137- yamlConfig , err := yaml .JSONToYAML (config .Raw )
138- if err != nil {
139- return "" , err
140- }
141-
142- return string (yamlConfig ), nil
14399}
144100
145101func GetDefaultSecurityContext () * corev1.SecurityContext {
0 commit comments