diff --git a/dev/binary_build.sh b/dev/binary_build.sh index aea581607..063ac716e 100755 --- a/dev/binary_build.sh +++ b/dev/binary_build.sh @@ -15,10 +15,16 @@ GIT_SHA=$(cd "${CUR_DIR}"; git rev-parse --short HEAD) "${SRC_ROOT}/manifests/operator/build-clickhouse-operator-install-yaml.sh" #CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${CUR_DIR}/clickhouse-operator ${SRC_ROOT}/cmd/clickhouse-operator -CGO_ENABLED=0 go build \ - -v -a \ +if CGO_ENABLED=0 go build \ + -a \ -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} -X ${REPO}/pkg/version.GitSHA=${GIT_SHA}" \ -o "${OPERATOR_BIN}" \ - "${SRC_ROOT}/cmd/manager/main.go" + "${SRC_ROOT}/cmd/manager/main.go"; then + echo "Build OK" +else + echo "WARING!" + echo "BUILD FAILED" + echo "Check logs for details" +fi exit $? diff --git a/docs/examples/10-zones-03-advanced-03-pod-per-host-default-storage-class.yaml b/docs/examples/10-zones-03-advanced-03-pod-per-host-default-storage-class.yaml index 3a6e34761..d0c30b5be 100644 --- a/docs/examples/10-zones-03-advanced-03-pod-per-host-default-storage-class.yaml +++ b/docs/examples/10-zones-03-advanced-03-pod-per-host-default-storage-class.yaml @@ -23,9 +23,8 @@ spec: templates: podTemplate: clickhouse-per-host volumeClaimTemplate: storage-vc-template - configuration: - templates: serviceTemplate: ch-service + configuration: clusters: - name: zoned layout: diff --git a/docs/examples/10-zones-04-advanced-04-pod-per-host-local-storage.yaml b/docs/examples/10-zones-04-advanced-04-pod-per-host-local-storage.yaml index cf42af7f1..8437b3eb8 100644 --- a/docs/examples/10-zones-04-advanced-04-pod-per-host-local-storage.yaml +++ b/docs/examples/10-zones-04-advanced-04-pod-per-host-local-storage.yaml @@ -22,9 +22,8 @@ spec: defaults: templates: podTemplate: clickhouse-per-host-localstorage - configuration: - templates: serviceTemplate: ch-service + configuration: clusters: - name: ch-localstorage layout: diff --git a/docs/examples/99-clickhouseinstallation-max.yaml b/docs/examples/99-clickhouseinstallation-max.yaml index cb23631b6..ab3e1e372 100644 --- a/docs/examples/99-clickhouseinstallation-max.yaml +++ b/docs/examples/99-clickhouseinstallation-max.yaml @@ -12,11 +12,10 @@ spec: templates: podTemplate: clickhouse-v18.16.1 volumeClaimTemplate: default-volume-claim + serviceTemplate: chi-service-template configuration: - templates: - serviceTemplate: chi-service-template - zookeeper: +s zookeeper: nodes: - host: zookeeper-0.zookeepers.zoo3ns.svc.cluster.local port: 2181 @@ -123,14 +122,14 @@ spec: templates: podTemplate: clickhouse-v18.16.1 volumeClaimTemplate: default-volume-claim - serviceTemplate: replica-service-template + replicaServiceTemplate: replica-service-template replicas: - name: replica0 port: 9000 templates: podTemplate: clickhouse-v18.16.2 volumeClaimTemplate: default-volume-claim - serviceTemplate: replica-service-template + replicaServiceTemplate: replica-service-template templates: serviceTemplates: diff --git a/docs/examples/evolution/01-persistent-volume.yaml b/docs/examples/evolution/01-persistent-volume.yaml new file mode 100644 index 000000000..2af427d7c --- /dev/null +++ b/docs/examples/evolution/01-persistent-volume.yaml @@ -0,0 +1,42 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: evolution +spec: + configuration: + clusters: + - name: cluster + # Templates are specified for this cluster explicitly + templates: + podTemplate: pod-template-with-volume + volumeClaimTemplate: storage-vc-template + layout: + shardsCount: 1 + replicasCount: 1 + + templates: + podTemplates: + - name: pod-template-with-volume + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.3.7 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + volumeClaimTemplates: + - name: storage-vc-template + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/docs/examples/evolution/02-introduce-replication.yaml b/docs/examples/evolution/02-introduce-replication.yaml new file mode 100644 index 000000000..7c41da6bc --- /dev/null +++ b/docs/examples/evolution/02-introduce-replication.yaml @@ -0,0 +1,45 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: evolution +spec: + configuration: + zookeeper: + nodes: + - host: zookeeper.zoo1ns + clusters: + - name: cluster + # Templates are specified for this cluster explicitly + templates: + podTemplate: pod-template-with-volume + volumeClaimTemplate: storage-vc-template + layout: + shardsCount: 1 + replicasCount: 2 + + templates: + podTemplates: + - name: pod-template-with-volume + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.3.7 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + volumeClaimTemplates: + - name: storage-vc-template + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/docs/examples/evolution/03-introduce-more-shards-and-zones.yaml b/docs/examples/evolution/03-introduce-more-shards-and-zones.yaml new file mode 100644 index 000000000..1ae825b26 --- /dev/null +++ b/docs/examples/evolution/03-introduce-more-shards-and-zones.yaml @@ -0,0 +1,50 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: evolution +spec: + configuration: + zookeeper: + nodes: + - host: zookeeper.zoo1ns + clusters: + - name: cluster + # Templates are specified for this cluster explicitly + templates: + podTemplate: pod-template-with-volume + volumeClaimTemplate: storage-vc-template + layout: + shardsCount: 2 + replicasCount: 2 + + templates: + podTemplates: + - name: pod-template-with-volume + zone: + key: "clickhouse" + values: + - "allow" + distribution: "OnePerHost" + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.3.7 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + volumeClaimTemplates: + - name: storage-vc-template + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/docs/examples/evolution/04-update-introduce-canary.yaml b/docs/examples/evolution/04-update-introduce-canary.yaml new file mode 100644 index 000000000..9f04501e9 --- /dev/null +++ b/docs/examples/evolution/04-update-introduce-canary.yaml @@ -0,0 +1,80 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: evolution +spec: + configuration: + zookeeper: + nodes: + - host: zookeeper.zoo1ns + clusters: + - name: cluster + # Templates are specified for this cluster explicitly + templates: + podTemplate: pod-template-with-volume + volumeClaimTemplate: storage-vc-template + layout: + shardsCount: 2 + replicasCount: 2 + shards: + - name: "1" + replicasCount: 2 + replicas: + - name: "1" + templates: + podTemplate: pod-template-with-volume-19.4 + volumeClaimTemplate: storage-vc-template + + + templates: + podTemplates: + - name: pod-template-with-volume + zone: + key: "clickhouse" + values: + - "allow" + distribution: "OnePerHost" + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.3.7 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + - name: pod-template-with-volume-19.4 + zone: + key: "clickhouse" + values: + - "allow" + distribution: "OnePerHost" + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.4.3.11 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + volumeClaimTemplates: + - name: storage-vc-template + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/docs/examples/evolution/05-update-propagate-update.yaml b/docs/examples/evolution/05-update-propagate-update.yaml new file mode 100644 index 000000000..16e629f08 --- /dev/null +++ b/docs/examples/evolution/05-update-propagate-update.yaml @@ -0,0 +1,50 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: evolution +spec: + configuration: + zookeeper: + nodes: + - host: zookeeper.zoo1ns + clusters: + - name: cluster + # Templates are specified for this cluster explicitly + templates: + podTemplate: pod-template-with-volume + volumeClaimTemplate: storage-vc-template + layout: + shardsCount: 2 + replicasCount: 2 + + templates: + podTemplates: + - name: pod-template-with-volume + zone: + key: "clickhouse" + values: + - "allow" + distribution: "OnePerHost" + spec: + containers: + - name: clickhouse + image: yandex/clickhouse-server:19.4.3.11 + ports: + - name: http + containerPort: 8123 + - name: client + containerPort: 9000 + - name: interserver + containerPort: 9009 + volumeMounts: + - name: storage-vc-template + mountPath: /var/lib/clickhouse + + volumeClaimTemplates: + - name: storage-vc-template + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/manifests/dev/clickhouse-operator-template-01-section-crd.yaml b/manifests/dev/clickhouse-operator-template-01-section-crd.yaml index 5ae07ac33..e5ac082a9 100644 --- a/manifests/dev/clickhouse-operator-template-01-section-crd.yaml +++ b/manifests/dev/clickhouse-operator-template-01-section-crd.yaml @@ -62,18 +62,15 @@ spec: type: string serviceTemplate: type: string - configuration: - type: object - properties: - templates: - type: object - properties: - podTemplate: + clusterServiceTemplate: type: string - volumeClaimTemplate: + shardServiceTemplate: type: string - serviceTemplate: + replicaServiceTemplate: type: string + configuration: + type: object + properties: zookeeper: type: object properties: @@ -122,6 +119,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string layout: type: object properties: @@ -160,6 +163,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string replicas: type: array items: @@ -180,6 +189,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string templates: type: object properties: diff --git a/manifests/operator/clickhouse-operator-install.yaml b/manifests/operator/clickhouse-operator-install.yaml index 20b69c806..5af0661d1 100644 --- a/manifests/operator/clickhouse-operator-install.yaml +++ b/manifests/operator/clickhouse-operator-install.yaml @@ -62,18 +62,15 @@ spec: type: string serviceTemplate: type: string - configuration: - type: object - properties: - templates: - type: object - properties: - podTemplate: + clusterServiceTemplate: type: string - volumeClaimTemplate: + shardServiceTemplate: type: string - serviceTemplate: + replicaServiceTemplate: type: string + configuration: + type: object + properties: zookeeper: type: object properties: @@ -122,6 +119,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string layout: type: object properties: @@ -160,6 +163,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string replicas: type: array items: @@ -180,6 +189,12 @@ spec: type: string serviceTemplate: type: string + clusterServiceTemplate: + type: string + shardServiceTemplate: + type: string + replicaServiceTemplate: + type: string templates: type: object properties: diff --git a/pkg/apis/clickhouse.altinity.com/v1/type_chi.go b/pkg/apis/clickhouse.altinity.com/v1/type_chi.go index 3aa5fd594..59947dfc2 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/type_chi.go +++ b/pkg/apis/clickhouse.altinity.com/v1/type_chi.go @@ -353,7 +353,7 @@ func (chi *ClickHouseInstallation) GetServiceTemplate(name string) (*ChiServiceT // GetServiceTemplate gets own ChiServiceTemplate func (chi *ClickHouseInstallation) GetOwnServiceTemplate() (*ChiServiceTemplate, bool) { - name := chi.Spec.Configuration.Templates.ServiceTemplate + name := chi.Spec.Defaults.Templates.serviceTemplate template, ok := chi.GetServiceTemplate(name) return template, ok } diff --git a/pkg/apis/clickhouse.altinity.com/v1/type_cluster.go b/pkg/apis/clickhouse.altinity.com/v1/type_cluster.go index ed6ffcecb..ed936d52e 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/type_cluster.go +++ b/pkg/apis/clickhouse.altinity.com/v1/type_cluster.go @@ -19,7 +19,7 @@ func (cluster *ChiCluster) InheritTemplates(chi *ClickHouseInstallation) { } func (cluster *ChiCluster) GetServiceTemplate() (*ChiServiceTemplate, bool) { - name := cluster.Templates.ServiceTemplate + name := cluster.Templates.ClusterServiceTemplate template, ok := cluster.Chi.GetServiceTemplate(name) return template, ok } diff --git a/pkg/apis/clickhouse.altinity.com/v1/type_replica.go b/pkg/apis/clickhouse.altinity.com/v1/type_replica.go index 1520fef89..2e036e6d0 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/type_replica.go +++ b/pkg/apis/clickhouse.altinity.com/v1/type_replica.go @@ -31,7 +31,7 @@ func (replica *ChiReplica) GetVolumeClaimTemplate() (*ChiVolumeClaimTemplate, bo } func (replica *ChiReplica) GetServiceTemplate() (*ChiServiceTemplate, bool) { - name := replica.Templates.ServiceTemplate + name := replica.Templates.ReplicaServiceTemplate template, ok := replica.Chi.GetServiceTemplate(name) return template, ok } diff --git a/pkg/apis/clickhouse.altinity.com/v1/type_shard.go b/pkg/apis/clickhouse.altinity.com/v1/type_shard.go index 546f32be4..6ce4bedf0 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/type_shard.go +++ b/pkg/apis/clickhouse.altinity.com/v1/type_shard.go @@ -19,7 +19,7 @@ func (shard *ChiShard) InheritTemplates(cluster *ChiCluster) { } func (shard *ChiShard) GetServiceTemplate() (*ChiServiceTemplate, bool) { - name := shard.Templates.ServiceTemplate + name := shard.Templates.ShardServiceTemplate template, ok := shard.Chi.GetServiceTemplate(name) return template, ok } diff --git a/pkg/apis/clickhouse.altinity.com/v1/types.go b/pkg/apis/clickhouse.altinity.com/v1/types.go index 54fd98a40..64026d7e0 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/types.go +++ b/pkg/apis/clickhouse.altinity.com/v1/types.go @@ -57,9 +57,12 @@ type ChiDefaults struct { // ChiTemplateNames defines references to .spec.templates to be used on current level of cluster type ChiTemplateNames struct { - PodTemplate string `json:"podTemplate,omitempty" yaml:"podTemplate"` - VolumeClaimTemplate string `json:"volumeClaimTemplate,omitempty" yaml:"volumeClaimTemplate"` - ServiceTemplate string `json:"serviceTemplate,omitempty" yaml:"serviceTemplate"` + PodTemplate string `json:"podTemplate,omitempty" yaml:"podTemplate"` + VolumeClaimTemplate string `json:"volumeClaimTemplate,omitempty" yaml:"volumeClaimTemplate"` + serviceTemplate string `json:"serviceTemplate,omitempty" yaml:"serviceTemplate"` + ClusterServiceTemplate string `json:"clusterServiceTemplate,omitempty" yaml:"clusterServiceTemplate"` + ShardServiceTemplate string `json:"shardServiceTemplate,omitempty" yaml:"shardServiceTemplate"` + ReplicaServiceTemplate string `json:"replicaServiceTemplate,omitempty" yaml:"replicaServiceTemplate"` } func (templates *ChiTemplateNames) MergeFrom(from *ChiTemplateNames) { @@ -69,14 +72,22 @@ func (templates *ChiTemplateNames) MergeFrom(from *ChiTemplateNames) { if templates.VolumeClaimTemplate == "" { templates.VolumeClaimTemplate = from.VolumeClaimTemplate } - if templates.ServiceTemplate == "" { - templates.ServiceTemplate = from.ServiceTemplate + if templates.serviceTemplate == "" { + templates.serviceTemplate = from.serviceTemplate + } + if templates.ClusterServiceTemplate == "" { + templates.ClusterServiceTemplate = from.ClusterServiceTemplate + } + if templates.ShardServiceTemplate == "" { + templates.ShardServiceTemplate = from.ShardServiceTemplate + } + if templates.ReplicaServiceTemplate == "" { + templates.ReplicaServiceTemplate = from.ReplicaServiceTemplate } } // ChiConfiguration defines configuration section of .spec type ChiConfiguration struct { - Templates ChiTemplateNames `json:"templates" yaml:"templates"` Zookeeper ChiZookeeperConfig `json:"zookeeper,omitempty" yaml:"zookeeper"` Users map[string]interface{} `json:"users,omitempty" yaml:"users"` Profiles map[string]interface{} `json:"profiles,omitempty" yaml:"profiles"` diff --git a/pkg/apis/clickhouse.altinity.com/v1/zz_generated.deepcopy.go b/pkg/apis/clickhouse.altinity.com/v1/zz_generated.deepcopy.go index b1e509c7d..93c184c46 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/zz_generated.deepcopy.go +++ b/pkg/apis/clickhouse.altinity.com/v1/zz_generated.deepcopy.go @@ -71,7 +71,6 @@ func (in *ChiClusterAddress) DeepCopy() *ChiClusterAddress { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChiConfiguration) DeepCopyInto(out *ChiConfiguration) { *out = *in - out.Templates = in.Templates in.Zookeeper.DeepCopyInto(&out.Zookeeper) if in.Users != nil { in, out := &in.Users, &out.Users diff --git a/pkg/model/namer.go b/pkg/model/namer.go index 3eb79ac9b..f3070a0bd 100644 --- a/pkg/model/namer.go +++ b/pkg/model/namer.go @@ -157,14 +157,14 @@ func getNamePartReplicaName(replica *chop.ChiReplica) string { return namePartReplicaName(replica.Address.ReplicaName) } -func newReplacerChi(chi *chop.ClickHouseInstallation) *strings.Replacer { +func newNameReplacerChi(chi *chop.ClickHouseInstallation) *strings.Replacer { return strings.NewReplacer( "{chi}", namePartChiName(chi.Name), "{chiID}", namePartChiNameID(chi.Name), ) } -func newReplacerCluster(cluster *chop.ChiCluster) *strings.Replacer { +func newNameReplacerCluster(cluster *chop.ChiCluster) *strings.Replacer { return strings.NewReplacer( "{chi}", namePartChiName(cluster.Address.ChiName), "{chiID}", namePartChiNameID(cluster.Address.ChiName), @@ -174,7 +174,7 @@ func newReplacerCluster(cluster *chop.ChiCluster) *strings.Replacer { ) } -func newReplacerShard(shard *chop.ChiShard) *strings.Replacer { +func newNameReplacerShard(shard *chop.ChiShard) *strings.Replacer { return strings.NewReplacer( "{chi}", namePartChiName(shard.Address.ChiName), "{chiID}", namePartChiNameID(shard.Address.ChiName), @@ -187,7 +187,7 @@ func newReplacerShard(shard *chop.ChiShard) *strings.Replacer { ) } -func newReplacerReplica(replica *chop.ChiReplica) *strings.Replacer { +func newNameReplacerReplica(replica *chop.ChiReplica) *strings.Replacer { return strings.NewReplacer( "{chi}", namePartChiName(replica.Address.ChiName), "{chiID}", namePartChiNameID(replica.Address.ChiName), @@ -205,17 +205,17 @@ func newReplacerReplica(replica *chop.ChiReplica) *strings.Replacer { // CreateConfigMapPodName returns a name for a ConfigMap for replica's pod func CreateConfigMapPodName(replica *chop.ChiReplica) string { - return newReplacerReplica(replica).Replace(configMapDeploymentNamePattern) + return newNameReplacerReplica(replica).Replace(configMapDeploymentNamePattern) } // CreateConfigMapCommonName returns a name for a ConfigMap for replica's common chopConfig func CreateConfigMapCommonName(chi *chop.ClickHouseInstallation) string { - return newReplacerChi(chi).Replace(configMapCommonNamePattern) + return newNameReplacerChi(chi).Replace(configMapCommonNamePattern) } // CreateConfigMapCommonUsersName returns a name for a ConfigMap for replica's common chopConfig func CreateConfigMapCommonUsersName(chi *chop.ClickHouseInstallation) string { - return newReplacerChi(chi).Replace(configMapCommonUsersNamePattern) + return newNameReplacerChi(chi).Replace(configMapCommonUsersNamePattern) } // CreateChiServiceName creates a name of a Installation Service resource @@ -224,12 +224,12 @@ func CreateChiServiceName(chi *chop.ClickHouseInstallation) string { // Service template available if template.GenerateName != "" { // Service template has explicitly specified service name template - return newReplacerChi(chi).Replace(template.GenerateName) + return newNameReplacerChi(chi).Replace(template.GenerateName) } } // Create Service name based on default Service Name template - return newReplacerChi(chi).Replace(chiServiceNamePattern) + return newNameReplacerChi(chi).Replace(chiServiceNamePattern) } // CreateChiServiceName creates a name of a Installation Service resource @@ -247,12 +247,12 @@ func CreateClusterServiceName(cluster *chop.ChiCluster) string { // Service template available if template.GenerateName != "" { // Service template has explicitly specified service name template - return newReplacerCluster(cluster).Replace(template.GenerateName) + return newNameReplacerCluster(cluster).Replace(template.GenerateName) } } // Create Service name based on default Service Name template - return newReplacerCluster(cluster).Replace(clusterServiceNamePattern) + return newNameReplacerCluster(cluster).Replace(clusterServiceNamePattern) } // CreateShardServiceName returns a name of a shard's Service @@ -261,17 +261,17 @@ func CreateShardServiceName(shard *chop.ChiShard) string { // Service template available if template.GenerateName != "" { // Service template has explicitly specified service name template - return newReplacerShard(shard).Replace(template.GenerateName) + return newNameReplacerShard(shard).Replace(template.GenerateName) } } // Create Service name based on default Service Name template - return newReplacerShard(shard).Replace(shardServiceNamePattern) + return newNameReplacerShard(shard).Replace(shardServiceNamePattern) } // CreateStatefulSetName creates a name of a StatefulSet for replica func CreateStatefulSetName(replica *chop.ChiReplica) string { - return newReplacerReplica(replica).Replace(statefulSetNamePattern) + return newNameReplacerReplica(replica).Replace(statefulSetNamePattern) } // CreateStatefulSetServiceName returns a name of a StatefulSet-related Service for replica @@ -280,12 +280,12 @@ func CreateStatefulSetServiceName(replica *chop.ChiReplica) string { // Service template available if template.GenerateName != "" { // Service template has explicitly specified service name template - return newReplacerReplica(replica).Replace(template.GenerateName) + return newNameReplacerReplica(replica).Replace(template.GenerateName) } } // Create Service name based on default Service Name template - return newReplacerReplica(replica).Replace(statefulSetServiceNamePattern) + return newNameReplacerReplica(replica).Replace(statefulSetServiceNamePattern) } // CreatePodHostname returns a name of a Pod resource for a replica