Skip to content

Commit 4e7f9d7

Browse files
authored
Add client service override spec.override.clientService (#213)
* Add client service override `spec.override.clientService` - this closes #142 - add an additional port example; using the client service override - make sts and svc override's name and namespace not configurable
1 parent 3ee3232 commit 4e7f9d7

File tree

10 files changed

+512
-46
lines changed

10 files changed

+512
-46
lines changed

api/v1beta1/rabbitmqcluster_types.go

+30-3
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,22 @@ type RabbitmqClusterSpec struct {
6565
}
6666

6767
type RabbitmqClusterOverrideSpec struct {
68-
StatefulSet *StatefulSet `json:"statefulSet,omitempty"`
68+
StatefulSet *StatefulSet `json:"statefulSet,omitempty"`
69+
ClientService *ClientService `json:"clientService,omitempty"`
70+
}
71+
72+
type ClientService struct {
73+
// +optional
74+
*EmbeddedLabelsAnnotations `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
75+
// Spec defines the behavior of a service.
76+
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
77+
// +optional
78+
Spec *corev1.ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
6979
}
7080

7181
type StatefulSet struct {
7282
// +optional
73-
*EmbeddedObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
83+
*EmbeddedLabelsAnnotations `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
7484
// Spec defines the desired identities of pods in this set.
7585
// +optional
7686
Spec *StatefulSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
@@ -134,9 +144,26 @@ type StatefulSetSpec struct {
134144
UpdateStrategy *appsv1.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"`
135145
}
136146

147+
// It is used in ClientService and StatefulSet
148+
type EmbeddedLabelsAnnotations struct {
149+
// Map of string keys and values that can be used to organize and categorize
150+
// (scope and select) objects. May match selectors of replication controllers
151+
// and services.
152+
// More info: http://kubernetes.io/docs/user-guide/labels
153+
// +optional
154+
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`
155+
156+
// Annotations is an unstructured key value map stored with a resource that may be
157+
// set by external tools to store and retrieve arbitrary metadata. They are not
158+
// queryable and should be preserved when modifying objects.
159+
// More info: http://kubernetes.io/docs/user-guide/annotations
160+
// +optional
161+
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`
162+
}
163+
137164
// EmbeddedObjectMeta contains a subset of the fields included in k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta
138165
// Only fields which are relevant to embedded resources are included.
139-
// It is used in StatefulSet, PersistentVolumeClaim, and PodTemplate
166+
// It is used in PersistentVolumeClaim and PodTemplate
140167
type EmbeddedObjectMeta struct {
141168
// Name must be unique within a namespace. Is required when creating resources, although
142169
// some resources may allow a client to request the generation of an appropriate name

api/v1beta1/zz_generated.deepcopy.go

+62-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)