Skip to content

Commit

Permalink
Reflect changes to observatorium operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkoyun committed Apr 7, 2020
1 parent 1e93dc1 commit 79a4c0c
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 6 deletions.
15 changes: 14 additions & 1 deletion api/v1alpha1/observatorium_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type ObservatoriumSpec struct {
QueryCache QueryCacheSpec `json:"queryCache"`
// Thanos StoreSpec
Store StoreSpec `json:"store"`
// Thanos StoreCache
StoreCache StoreCacheSpec `json:"storeCache"`
// Thanos RulerSpec
Rule RuleSpec `json:"rule"`
// API Gateway
Expand Down Expand Up @@ -71,6 +73,17 @@ type StoreSpec struct {
Shards *int32 `json:"shards,omitempty"`
}

type StoreCacheSpec struct {
// Memcached image
Image string `json:"image"`
// Version of Memcached image to be deployed.
Version string `json:"version,omitempty"`
// Number of Memcached replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Memory limit of Memcached in megabytes.
MemoryLimitMB *int32 `json:"memory_limit_mb,omitempty"`
}

type APIGatewaySpec struct {
// API Gateway image
Image string `json:"image"`
Expand Down Expand Up @@ -103,7 +116,7 @@ type QueryCacheSpec struct {
Image string `json:"image"`
// Number of Query Cache replicas.
Replicas *int32 `json:"replicas,omitempty"`
// Version of Query Cache image to be deployed.
// Version of Query Cache image to be deployed.
Version string `json:"version,omitempty"`
}

Expand Down
26 changes: 26 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions deploy/crds/core.observatorium.io_observatoria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
controller-gen.kubebuilder.io/version: v0.2.8
creationTimestamp: null
name: observatoria.core.observatorium.io
spec:
Expand Down Expand Up @@ -239,7 +239,7 @@ spec:
format: int32
type: integer
version:
description: Version of Query Cache image to be deployed.
description: Version of Query Cache image to be deployed.
type: string
required:
- image
Expand Down Expand Up @@ -664,6 +664,26 @@ spec:
required:
- volumeClaimTemplate
type: object
storeCache:
description: Thanos StoreCache
properties:
image:
description: Memcached image
type: string
memory_limit_mb:
description: Memory limit of Memcached in megabytes.
format: int32
type: integer
replicas:
description: Number of Memcached replicas.
format: int32
type: integer
version:
description: Version of Memcached image to be deployed.
type: string
required:
- image
type: object
thanosImage:
description: Thanos Image name
type: string
Expand Down Expand Up @@ -692,6 +712,7 @@ spec:
- receivers
- rule
- store
- storeCache
- thanosImage
- thanosReceiveController
- thanosVersion
Expand Down
1 change: 1 addition & 0 deletions environments/base/default-config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
image: 'docker.io/memcached:' + scConfig.version,
exporterVersion: 'v0.6.0',
exporterImage: 'prom/memcached-exporter:' + scConfig.exporterVersion,
memoryLimitMb: 1024,
},

query: {
Expand Down
4 changes: 3 additions & 1 deletion environments/openshift/manifests/observatorium-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2872,12 +2872,14 @@ parameters:
value: 500m
- name: THANOS_STORE_MEMCACHED_CPU_LIMIT
value: "3"
- name: THANOS_STORE_MEMCACHED_REPLICAS
value: "1"
- name: THANOS_STORE_MEMCACHED_MEMORY_LIMIT_MB
value: "1024"
- name: THANOS_STORE_MEMCACHED_MEMORY_REQUEST
value: 1329Mi
- name: THANOS_STORE_MEMCACHED_MEMORY_LIMIT
value: 1844Mi
value: 1536Mi
- name: THANOS_STORE_MEMCACHED_EXPORTER_CPU_REQUEST
value: 50m
- name: THANOS_STORE_MEMCACHED_EXPORTER_CPU_LIMIT
Expand Down
4 changes: 4 additions & 0 deletions environments/openshift/obs.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,10 @@ local up = (import '../../components/up.libsonnet');
name: 'THANOS_STORE_MEMCACHED_CPU_LIMIT',
value: '3',
},
{
name: 'THANOS_STORE_MEMCACHED_REPLICAS',
value: '1',
},
{
name: 'THANOS_STORE_MEMCACHED_MEMORY_LIMIT_MB',
value: '1024',
Expand Down
12 changes: 10 additions & 2 deletions environments/operator/operator-config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,22 @@ cr.spec {
version: thanosVersion,
objectStorageConfig: objectStorageConfig,
},
query: {
storeCache+:: {
image: cr.spec.storeCache.image,
version: cr.spec.storeCache.version,
replicas: cr.spec.storeCache.replicas,
memoryLimitMb: cr.spec.storeCache.memoryLimitMb,
exporterVersion: 'v0.6.0',
exporterImage: 'prom/memcached-exporter:' + scConfig.exporterVersion,
},
query+:: {
image: thanosImage,
version: thanosVersion,
},
queryCache+:: {
image: cr.spec.queryCache.image,
},
apiGatewayQuery: {
apiGatewayQuery+:: {
image: thanosImage,
version: thanosVersion,
},
Expand Down
6 changes: 6 additions & 0 deletions example/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ local obs = (import '../environments/base/observatorium.jsonnet');
volumeClaimTemplate: obs.config.store.volumeClaimTemplate,
shards: obs.config.store.shards,
},
storeCache: {
image: obs.config.storeCache.image,
version: obs.config.storeCache.version,
replicas: obs.config.storeCache.replicas,
memoryLimitMb: obs.config.storeCache.memoryLimitMb,
},
compact: {
volumeClaimTemplate: obs.config.compact.volumeClaimTemplate,
retentionResolutionRaw: obs.config.compact.retentionResolutionRaw,
Expand Down
5 changes: 5 additions & 0 deletions example/manifests/observatorium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ spec:
resources:
requests:
storage: 50Gi
storeCache:
image: docker.io/memcached:1.6.3-alpine
memoryLimitMb: 1024
replicas: 1
version: 1.6.3-alpine
thanosImage: quay.io/thanos/thanos:v0.12.0-rc.0
thanosReceiveController:
image: quay.io/observatorium/thanos-receive-controller:master-2020-02-06-b66e0c8
Expand Down

0 comments on commit 79a4c0c

Please sign in to comment.