Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
savnadya committed Dec 26, 2024
1 parent f876a15 commit 89a8341
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 9 deletions.
8 changes: 1 addition & 7 deletions config/samples/cluster_v1_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Ytsaurus
metadata:
name: minisaurus
spec:
coreImage: ghcr.io/ytsaurus/ytsaurus-nightly:dev-24.2-2024-12-06-ee9e61d820c81624e2562edca351e9bc8bdd7e2e
coreImage: ghcr.io/ytsaurus/ytsaurus:stable-23.2.0-relwithdebinfo

discovery:
instanceCount: 1
Expand All @@ -28,12 +28,6 @@ spec:
minLogLevel: error
writerType: stderr

kafkaProxies:
- serviceType: NodePort
loggers: *loggers
instanceCount: 1
role: default

primaryMasters:
instanceCount: 1
cellTag: 1
Expand Down
171 changes: 171 additions & 0 deletions config/samples/cluster_v1_local_with_kafka.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
apiVersion: cluster.ytsaurus.tech/v1
kind: Ytsaurus
metadata:
name: minisaurus
spec:
coreImage: ghcr.io/ytsaurus/ytsaurus-nightly:dev-24.2-2024-12-06-ee9e61d820c81624e2562edca351e9bc8bdd7e2e

discovery:
instanceCount: 1

# Make reusable loggers config with yaml anchor.
loggers: &loggers
- name: debug
compression: zstd
minLogLevel: debug
writerType: file
rotationPolicy: &rotationPolicy
maxTotalSizeToKeep: 10000000
rotationPeriodMilliseconds: 900000
categoriesFilter:
type: exclude
values: [ "Bus", "Concurrency" ]
- name: info
minLogLevel: info
writerType: file
rotationPolicy: *rotationPolicy
- name: error
minLogLevel: error
writerType: stderr

kafkaProxies:
- serviceType: NodePort
loggers: *loggers
instanceCount: 1
role: default
image: ghcr.io/ytsaurus/ytsaurus-nightly:dev-24.2-2024-12-26-d79040f9b4037aabf1f6b686e442cc029679a285

primaryMasters:
instanceCount: 1
cellTag: 1
loggers: *loggers
locations:
- locationType: MasterChangelogs
path: /yt/master-data/master-changelogs
- locationType: MasterSnapshots
path: /yt/master-data/master-snapshots

volumeMounts:
- name: master-data
mountPath: /yt/master-data

volumeClaimTemplates:
- metadata:
name: master-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi

httpProxies:
- serviceType: NodePort
loggers: *loggers
instanceCount: 1
role: default
- serviceType: NodePort
loggers: *loggers
instanceCount: 1
role: control

rpcProxies:
- instanceCount: 1
loggers: *loggers
role: default
- instanceCount: 1
loggers: *loggers
role: heavy

dataNodes:
- instanceCount: 3
loggers: *loggers

volumeMounts:
- name: node-data
mountPath: /yt/node-data

locations:
- locationType: ChunkStore
path: /yt/node-data/chunk-store

volumeClaimTemplates:
- metadata:
name: node-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi

execNodes:
- instanceCount: 1
loggers: *loggers
resources:
limits:
cpu: 1
memory: 2Gi

volumeMounts:
- name: node-data
mountPath: /yt/node-data

volumes:
- name: node-data
emptyDir:
sizeLimit: 5Gi

locations:
- locationType: ChunkCache
path: /yt/node-data/chunk-cache
- locationType: Slots
path: /yt/node-data/slots

jobProxyLoggers:
- name: debug
compression: zstd
minLogLevel: debug
writerType: file
useTimestampSuffix: true
rotationPolicy: &rotationPolicy
maxTotalSizeToKeep: 10000000
rotationPeriodMilliseconds: 900000
categoriesFilter:
type: exclude
values: [ "Bus", "Concurrency" ]
- name: info
minLogLevel: info
writerType: file
rotationPolicy: *rotationPolicy
- name: error
minLogLevel: error
writerType: stderr

schedulers:
instanceCount: 1
loggers: *loggers

controllerAgents:
instanceCount: 1
loggers: *loggers

ui:
image: ghcr.io/ytsaurus/ui:stable
serviceType: NodePort
instanceCount: 1

strawberry:
resources:
limits:
memory: 100Mi
image: ghcr.io/ytsaurus/strawberry:0.0.11

tabletNodes:
- instanceCount: 1

yqlAgents:
instanceCount: 1
image: ghcr.io/ytsaurus/query-tracker:0.0.6

queryTrackers:
instanceCount: 1
image: ghcr.io/ytsaurus/query-tracker:0.0.6
10 changes: 10 additions & 0 deletions pkg/components/kafka_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ func NewKafkaProxy(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus, maste
func() ([]byte, error) {
return cfgen.GetKafkaProxyConfig(spec)
},
WithContainerPorts(corev1.ContainerPort{
Name: consts.YTRPCPortName,
ContainerPort: consts.KafkaProxyRPCPort,
Protocol: corev1.ProtocolTCP,
}),
WithContainerPorts(corev1.ContainerPort{
Name: consts.KafkaPortName,
ContainerPort: consts.KafkaProxyKafkaPort,
Protocol: corev1.ProtocolTCP,
}),
)

var balancingService *resources.RPCService = nil
Expand Down
4 changes: 3 additions & 1 deletion pkg/consts/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package consts

const (
YTRPCPortName = "rpc"
KafkaPortName = "kafka"

YTMonitoringContainerPortName = "metrics"
YTMonitoringServicePortName = "ytsaurus-metrics"
Expand Down Expand Up @@ -62,5 +63,6 @@ const (
MasterCachesMonitoringPort = 10018

KafkaProxyMonitoringPort = 10020
KafkaProxyKafkaPort = 80
KafkaProxyKafkaPort = 9023
KafkaProxyRPCPort = 9021
)
2 changes: 1 addition & 1 deletion pkg/consts/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func ComponentLabel(component ComponentType) string {
case TcpProxyType:
return "yt-tcp-proxy"
case KafkaProxyType:
return "yt-kp-proxy"
return "yt-kafka-proxy"
case QueueAgentType:
return "yt-queue-agent"
case QueryTrackerType:
Expand Down
1 change: 1 addition & 0 deletions pkg/ytconfig/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func getKafkaProxyServerCarcass(spec *ytv1.KafkaProxiesSpec) (KafkaProxyServer,
var c KafkaProxyServer

c.MonitoringPort = *spec.InstanceSpec.MonitoringPort
c.RPCPort = consts.KafkaProxyRPCPort

c.Role = spec.Role
c.Auth.RequireAuthentication = true
Expand Down

0 comments on commit 89a8341

Please sign in to comment.