From b546cc93030ca4a5acff8d48e458d5a22eae5f9c Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Fri, 8 Nov 2024 20:30:01 +0800 Subject: [PATCH 01/33] build: k8s improve. --- Dockerfile | 6 +- go.mod | 34 ++++++++- go.sum | 75 ++++++++++++++++--- magefile.go | 3 +- magefile_unix.go | 3 +- pkg/common/cmd/root.go | 7 +- pkg/common/config/constant.go | 6 ++ pkg/common/config/load_config.go | 39 +++++++++- .../discoveryregister/discoveryregister.go | 9 ++- scripts/create-topic.sh | 16 +--- start-config.yml | 2 +- tools/check-component/main.go | 12 +-- tools/seq/internal/main.go | 22 +++--- 13 files changed, 173 insertions(+), 61 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8cfbda9ef..1c3de867ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use Go 1.21 Alpine as the base image for building the application -FROM golang:1.21-alpine AS builder +FROM golang:1.22-alpine AS builder # Define the base directory for the application as an environment variable ENV SERVER_DIR=/openim-server @@ -22,7 +22,7 @@ RUN go install github.com/magefile/mage@v1.15.0 RUN mage build # Using Alpine Linux with Go environment for the final image -FROM golang:1.21-alpine +FROM golang:1.22-alpine # Install necessary packages, such as bash RUN apk add --no-cache bash @@ -43,7 +43,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -RUN go get github.com/openimsdk/gomake@v0.0.14-alpha.5 +RUN go get github.com/mo3et/openim-gomake@v0.0.18 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/go.mod b/go.mod index 051beb4039..5ba69f6cbf 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/openimsdk/open-im-server/v3 -go 1.21.2 +go 1.22.0 + +toolchain go1.23.2 require ( firebase.google.com/go/v4 v4.14.1 @@ -13,7 +15,7 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/protocol v0.0.72-alpha.54 - github.com/openimsdk/tools v0.0.50-alpha.16 + github.com/openimsdk/tools v0.0.50-alpha.23 github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.18.0 github.com/stretchr/testify v1.9.0 @@ -35,7 +37,7 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/kelindar/bitmap v1.5.2 github.com/likexian/gokit v0.25.13 - github.com/openimsdk/gomake v0.0.14-alpha.5 + github.com/mo3et/openim-gomake v0.0.18 github.com/redis/go-redis/v9 v9.4.0 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil v3.21.11+incompatible @@ -88,19 +90,27 @@ require ( github.com/eapache/go-resiliency v1.6.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.3 // indirect @@ -117,6 +127,7 @@ require ( github.com/jinzhu/copier v0.4.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kelindar/simd v1.1.2 // indirect github.com/klauspost/compress v1.17.7 // indirect @@ -126,6 +137,7 @@ require ( github.com/lithammer/shortuuid v3.0.0+incompatible // indirect github.com/magefile/mage v1.15.0 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/minio/md5-simd v1.1.2 // indirect @@ -135,6 +147,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/mozillazg/go-httpheader v0.4.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -156,6 +169,7 @@ require ( github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect @@ -177,13 +191,25 @@ require ( golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine/v2 v2.0.2 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gorm.io/gorm v1.25.8 // indirect + k8s.io/api v0.31.2 // indirect + k8s.io/apimachinery v0.31.2 // indirect + k8s.io/client-go v0.31.2 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect stathat.com/c/consistent v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 816c820946..2ed7788e90 100644 --- a/go.sum +++ b/go.sum @@ -103,6 +103,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4A github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -117,6 +119,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gin-contrib/gzip v1.0.1 h1:HQ8ENHODeLY7a4g1Au/46Z92bdGFl74OhxcZble9WJE= @@ -126,12 +130,19 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -150,6 +161,8 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redismock/v9 v9.2.0 h1:ZrMYQeKPECZPjOj5u9eyOjg8Nnb0BS9lkVIZ6IpsKLw= github.com/go-redis/redismock/v9 v9.2.0/go.mod h1:18KHfGDK4Y6c2R0H38EUGWAdc7ZQS9gfYxc94k7rWT0= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= @@ -179,6 +192,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -186,14 +201,19 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -244,6 +264,8 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kelindar/bitmap v1.5.2 h1:XwX7CTvJtetQZ64zrOkApoZZHBJRkjE23NfqUALA/HE= @@ -285,6 +307,8 @@ github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -301,6 +325,8 @@ github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5 github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mo3et/openim-gomake v0.0.18 h1:PlX+Sx6UqIBKhe+BlmU8fHs5BbUKqMl4rKqWGDxGQCA= +github.com/mo3et/openim-gomake v0.0.18/go.mod h1:gyCVDWC6L32//+HIf47EeB53S2JYsl3QZDFpC/m6kbE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -311,18 +337,20 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJ github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mozillazg/go-httpheader v0.4.0 h1:aBn6aRXtFzyDLZ4VIRLsZbbJloagQfMnCiYgOq6hK4w= github.com/mozillazg/go-httpheader v0.4.0/go.mod h1:PuT8h0pw6efvp8ZeUec1Rs7dwjK08bt6gKSReGMqtdA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= -github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCFsz7t7vbv7Y= -github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.72-alpha.54 h1:opato7N4QjjRq/SHD54bDSVBpOEEDp1VLWVk5Os2A9s= github.com/openimsdk/protocol v0.0.72-alpha.54/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8= -github.com/openimsdk/tools v0.0.50-alpha.16 h1:bC1AQvJMuOHtZm8LZRvN8L5mH1Ws2VYdL+TLTs1iGSc= -github.com/openimsdk/tools v0.0.50-alpha.16/go.mod h1:h1cYmfyaVtgFbKmb1Cfsl8XwUOMTt8ubVUQrdGtsUh4= +github.com/openimsdk/tools v0.0.50-alpha.23 h1:gGCOVDFC/wrj2ybLrSrykGlcTfB1Z7MwfiWpEnjJKyU= +github.com/openimsdk/tools v0.0.50-alpha.23/go.mod h1:r5U6RbxcR4xhKb2fhTmKGC9Yt5LcErHBVt3lhXQIHSo= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= @@ -356,8 +384,8 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -410,6 +438,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= @@ -449,8 +479,8 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= @@ -527,6 +557,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -548,6 +580,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -592,11 +626,14 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -607,7 +644,25 @@ gorm.io/gorm v1.25.8 h1:WAGEZ/aEcznN4D03laj8DKnehe1e9gYQAjW8xyPRdeo= gorm.io/gorm v1.25.8/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= +k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= stathat.com/c/consistent v1.0.0 h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c= stathat.com/c/consistent v1.0.0/go.mod h1:QkzMWzcbB+yQBL2AttO6sgsQS/JSTapcDISJalmCDS0= diff --git a/magefile.go b/magefile.go index a8a1c40400..efa27bd583 100644 --- a/magefile.go +++ b/magefile.go @@ -4,8 +4,9 @@ package main import ( - "github.com/openimsdk/gomake/mageutil" "os" + + "github.com/mo3et/openim-gomake/mageutil" ) var Default = Build diff --git a/magefile_unix.go b/magefile_unix.go index ff6b6de4e4..1acf8fdd6c 100644 --- a/magefile_unix.go +++ b/magefile_unix.go @@ -4,8 +4,9 @@ package main import ( - "github.com/openimsdk/gomake/mageutil" "syscall" + + "github.com/mo3et/openim-gomake/mageutil" ) func setMaxOpenFiles() error { diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go index 5edea43773..0454bbae57 100644 --- a/pkg/common/cmd/root.go +++ b/pkg/common/cmd/root.go @@ -16,7 +16,6 @@ package cmd import ( "fmt" - "path/filepath" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/version" @@ -108,15 +107,13 @@ func (r *RootCmd) initializeConfiguration(cmd *cobra.Command, opts *CmdOpts) err // Load common configuration file //opts.configMap[ShareFileName] = StructEnvPrefix{EnvPrefix: shareEnvPrefix, ConfigStruct: &r.share} for configFileName, configStruct := range opts.configMap { - err := config.LoadConfig(filepath.Join(configDirectory, configFileName), - ConfigEnvPrefixMap[configFileName], configStruct) + err := config.Load(configDirectory, configFileName, ConfigEnvPrefixMap[configFileName], configStruct) if err != nil { return err } } // Load common log configuration file - return config.LoadConfig(filepath.Join(configDirectory, LogConfigFileName), - ConfigEnvPrefixMap[LogConfigFileName], &r.log) + return config.Load(configDirectory, LogConfigFileName, ConfigEnvPrefixMap[LogConfigFileName], &r.log) } func (r *RootCmd) applyOptions(opts ...func(*CmdOpts)) *CmdOpts { diff --git a/pkg/common/config/constant.go b/pkg/common/config/constant.go index f425a624ce..9aeaedca9f 100644 --- a/pkg/common/config/constant.go +++ b/pkg/common/config/constant.go @@ -16,6 +16,12 @@ package config const ConfKey = "conf" +const ( + MountConfigFilePath = "CONFIG_PATH" + DeploymentType = "DEPLOYMENT_TYPE" + KUBERNETES = "kubernetes" +) + const ( // DefaultDirPerm is used for creating general directories, allowing the owner to read, write, and execute, // while the group and others can only read and execute. diff --git a/pkg/common/config/load_config.go b/pkg/common/config/load_config.go index 9272896b45..16ad2821e1 100644 --- a/pkg/common/config/load_config.go +++ b/pkg/common/config/load_config.go @@ -1,13 +1,28 @@ package config import ( + "os" + "path/filepath" + "strings" + "github.com/mitchellh/mapstructure" "github.com/openimsdk/tools/errs" "github.com/spf13/viper" - "strings" ) -func LoadConfig(path string, envPrefix string, config any) error { +func Load(configDirectory string, configFileName string, envPrefix string, config any) error { + if os.Getenv(DeploymentType) == KUBERNETES { + mountPath := os.Getenv(MountConfigFilePath) + if mountPath == "" { + return errs.ErrArgs.WrapMsg(MountConfigFilePath + " env is empty") + } + return loadConfigK8s(filepath.Join(mountPath, configFileName), envPrefix, config) + + } + return loadConfig(filepath.Join(configDirectory, configFileName), envPrefix, config) +} + +func loadConfig(path string, envPrefix string, config any) error { v := viper.New() v.SetConfigFile(path) v.SetEnvPrefix(envPrefix) @@ -25,3 +40,23 @@ func LoadConfig(path string, envPrefix string, config any) error { } return nil } + +func loadConfigK8s(mountPath string, envPrefix string, config any) error { + // configFilePath := filepath.Join(mountPath, configFileName) + v := viper.New() + v.SetConfigFile(mountPath) + v.SetEnvPrefix(envPrefix) + v.AutomaticEnv() + v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + + if err := v.ReadInConfig(); err != nil { + return errs.WrapMsg(err, "failed to read config file", "path", mountPath, "envPrefix", envPrefix) + } + + if err := v.Unmarshal(config, func(config *mapstructure.DecoderConfig) { + config.TagName = "mapstructure" + }); err != nil { + return errs.WrapMsg(err, "failed to unmarshal config", "path", mountPath, "envPrefix", envPrefix) + } + return nil +} diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 559c937c10..1911c0abfd 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -15,13 +15,14 @@ package discoveryregister import ( + "time" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/discovery/etcd" + "github.com/openimsdk/tools/discovery/kubernetes" "github.com/openimsdk/tools/discovery/zookeeper" "github.com/openimsdk/tools/errs" - "time" ) // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. @@ -36,8 +37,8 @@ func NewDiscoveryRegister(discovery *config.Discovery, share *config.Share) (dis zookeeper.WithRoundRobin(), zookeeper.WithTimeout(10), ) - case "k8s": - return kubernetes.NewK8sDiscoveryRegister(share.RpcRegisterName.MessageGateway) + case "kubernetes": + return kubernetes.NewK8sConnManager("default") case "etcd": return etcd.NewSvcDiscoveryRegistry( discovery.Etcd.RootDirectory, diff --git a/scripts/create-topic.sh b/scripts/create-topic.sh index bbc739287f..866230e4f4 100755 --- a/scripts/create-topic.sh +++ b/scripts/create-topic.sh @@ -1,21 +1,7 @@ #!/usr/bin/env bash -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # Wait for Kafka to be ready -KAFKA_SERVER=localhost:9092 +KAFKA_SERVER=kafka-service:9092 MAX_ATTEMPTS=300 attempt_num=1 diff --git a/start-config.yml b/start-config.yml index 1231b5d0d4..3ffd540ae1 100644 --- a/start-config.yml +++ b/start-config.yml @@ -13,6 +13,6 @@ serviceBinaries: openim-rpc-third: 1 toolBinaries: - check-free-memory - - check-component + # - check-component - seq maxFileDescriptors: 10000 diff --git a/tools/check-component/main.go b/tools/check-component/main.go index 4f4c08c16a..9ca623a4fe 100644 --- a/tools/check-component/main.go +++ b/tools/check-component/main.go @@ -78,35 +78,35 @@ func initConfig(configDir string) (*config.Mongo, *config.Redis, *config.Kafka, discovery = &config.Discovery{} thirdConfig = &config.Third{} ) - err := config.LoadConfig(filepath.Join(configDir, cmd.MongodbConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig) + err := config.Load(configDir, cmd.MongodbConfigFileName, cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig) if err != nil { return nil, nil, nil, nil, nil, err } - err = config.LoadConfig(filepath.Join(configDir, cmd.RedisConfigFileName), cmd.ConfigEnvPrefixMap[cmd.RedisConfigFileName], redisConfig) + err = config.Load(configDir, cmd.RedisConfigFileName, cmd.ConfigEnvPrefixMap[cmd.RedisConfigFileName], redisConfig) if err != nil { return nil, nil, nil, nil, nil, err } - err = config.LoadConfig(filepath.Join(configDir, cmd.KafkaConfigFileName), cmd.ConfigEnvPrefixMap[cmd.KafkaConfigFileName], kafkaConfig) + err = config.Load(configDir, cmd.KafkaConfigFileName, cmd.ConfigEnvPrefixMap[cmd.KafkaConfigFileName], kafkaConfig) if err != nil { return nil, nil, nil, nil, nil, err } - err = config.LoadConfig(filepath.Join(configDir, cmd.OpenIMRPCThirdCfgFileName), cmd.ConfigEnvPrefixMap[cmd.OpenIMRPCThirdCfgFileName], thirdConfig) + err = config.Load(configDir, cmd.OpenIMRPCThirdCfgFileName, cmd.ConfigEnvPrefixMap[cmd.OpenIMRPCThirdCfgFileName], thirdConfig) if err != nil { return nil, nil, nil, nil, nil, err } if thirdConfig.Object.Enable == "minio" { - err = config.LoadConfig(filepath.Join(configDir, cmd.MinioConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MinioConfigFileName], minioConfig) + err = config.Load(configDir, cmd.MinioConfigFileName, cmd.ConfigEnvPrefixMap[cmd.MinioConfigFileName], minioConfig) if err != nil { return nil, nil, nil, nil, nil, err } } else { minioConfig = nil } - err = config.LoadConfig(filepath.Join(configDir, cmd.DiscoveryConfigFilename), cmd.ConfigEnvPrefixMap[cmd.DiscoveryConfigFilename], discovery) + err = config.Load(configDir, cmd.DiscoveryConfigFilename, cmd.ConfigEnvPrefixMap[cmd.DiscoveryConfigFilename], discovery) if err != nil { return nil, nil, nil, nil, nil, err } diff --git a/tools/seq/internal/main.go b/tools/seq/internal/main.go index 2bec5a8f1c..cb6387a9cf 100644 --- a/tools/seq/internal/main.go +++ b/tools/seq/internal/main.go @@ -5,6 +5,16 @@ import ( "context" "errors" "fmt" + "os" + "os/signal" + "path/filepath" + "strconv" + "strings" + "sync" + "sync/atomic" + "syscall" + "time" + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" @@ -15,15 +25,6 @@ import ( "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "gopkg.in/yaml.v3" - "os" - "os/signal" - "path/filepath" - "strconv" - "strings" - "sync" - "sync/atomic" - "syscall" - "time" ) const ( @@ -41,6 +42,9 @@ const ( ) func readConfig[T any](dir string, name string) (*T, error) { + if os.Getenv(config.DeploymentType) == config.KUBERNETES { + dir = os.Getenv(config.MountConfigFilePath) + } data, err := os.ReadFile(filepath.Join(dir, name)) if err != nil { return nil, err From 2909896f299bf2d005d20baef8b9b5f808569726 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 12 Nov 2024 18:34:42 +0800 Subject: [PATCH 02/33] refactor: update docker image contents. --- build/images/Dockerfile | 38 +++--- build/images/openim-api/Dockerfile | 76 +++++++---- build/images/openim-cmdutils/Dockerfile | 60 ++++---- build/images/openim-crontask/Dockerfile | 76 +++++++---- build/images/openim-msggateway/Dockerfile | 76 +++++++---- build/images/openim-msgtransfer/Dockerfile | 76 +++++++---- build/images/openim-push/Dockerfile | 76 +++++++---- build/images/openim-rpc-auth/Dockerfile | 76 +++++++---- .../images/openim-rpc-conversation/Dockerfile | 76 +++++++---- build/images/openim-rpc-friend/Dockerfile | 76 +++++++---- build/images/openim-rpc-group/Dockerfile | 76 +++++++---- build/images/openim-rpc-msg/Dockerfile | 76 +++++++---- build/images/openim-rpc-third/Dockerfile | 76 +++++++---- build/images/openim-rpc-user/Dockerfile | 76 +++++++---- .../images/openim-tools/component/Dockerfile | 129 +++++++++++++----- 15 files changed, 697 insertions(+), 442 deletions(-) diff --git a/build/images/Dockerfile b/build/images/Dockerfile index 51fe94e1c5..020d507865 100644 --- a/build/images/Dockerfile +++ b/build/images/Dockerfile @@ -1,24 +1,24 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# # Copyright © 2023 OpenIM. All rights reserved. +# # +# # Licensed under the Apache License, Version 2.0 (the "License"); +# # you may not use this file except in compliance with the License. +# # You may obtain a copy of the License at +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # Unless required by applicable law or agreed to in writing, software +# # distributed under the License is distributed on an "AS IS" BASIS, +# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# # See the License for the specific language governing permissions and +# # limitations under the License. -FROM BASE_IMAGE +# FROM BASE_IMAGE -WORKDIR ${SERVER_WORKDIR} +# WORKDIR ${SERVER_WORKDIR} -# Set HTTP proxy -ARG BINARY_NAME +# # Set HTTP proxy +# ARG BINARY_NAME -COPY BINARY_NAME ./bin/BINARY_NAME +# COPY BINARY_NAME ./bin/BINARY_NAME -ENTRYPOINT ["./bin/BINARY_NAME"] \ No newline at end of file +# ENTRYPOINT ["./bin/BINARY_NAME"] \ No newline at end of file diff --git a/build/images/openim-api/Dockerfile b/build/images/openim-api/Dockerfile index 6622239569..cd8cb509d6 100644 --- a/build/images/openim-api/Dockerfile +++ b/build/images/openim-api/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-api + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-api -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-api /usr/bin/openim-api +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-api: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-api ./bin/openim-api +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-api"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-cmdutils/Dockerfile b/build/images/openim-cmdutils/Dockerfile index 34bcd41f5d..e8589439a1 100644 --- a/build/images/openim-cmdutils/Dockerfile +++ b/build/images/openim-cmdutils/Dockerfile @@ -1,44 +1,44 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# # Copyright © 2023 OpenIM. All rights reserved. +# # +# # Licensed under the Apache License, Version 2.0 (the "License"); +# # you may not use this file except in compliance with the License. +# # You may obtain a copy of the License at +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # Unless required by applicable law or agreed to in writing, software +# # distributed under the License is distributed on an "AS IS" BASIS, +# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# # See the License for the specific language governing permissions and +# # limitations under the License. -# OpenIM base image: https://github.com/openim-sigs/openim-base-image +# # OpenIM base image: https://github.com/openim-sigs/openim-base-image -# Set go mod installation source and proxy +# # Set go mod installation source and proxy -FROM golang:1.20 AS builder +# FROM golang:1.20 AS builder -ARG GO111MODULE=on +# ARG GO111MODULE=on -WORKDIR /openim/openim-server +# WORKDIR /openim/openim-server -ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +# ENV GO111MODULE=$GO111MODULE +# ENV GOPROXY=$GOPROXY -COPY go.mod go.sum ./ -RUN go mod download +# COPY go.mod go.sum ./ +# RUN go mod download -COPY . . +# COPY . . -RUN make build BINS=openim-cmdutils -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-cmdutils /usr/bin/openim-cmdutils +# RUN make build BINS=openim-cmdutils +# RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-cmdutils /usr/bin/openim-cmdutils -FROM ghcr.io/openim-sigs/openim-bash-image:latest +# FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +# WORKDIR /openim/openim-server -COPY --from=builder /usr/bin/openim-cmdutils ./bin/openim-cmdutils +# COPY --from=builder /usr/bin/openim-cmdutils ./bin/openim-cmdutils -ENTRYPOINT ["./bin/openim-cmdutils"] +# ENTRYPOINT ["./bin/openim-cmdutils"] -CMD ["--help"] +# CMD ["--help"] diff --git a/build/images/openim-crontask/Dockerfile b/build/images/openim-crontask/Dockerfile index 90a5629264..97e68a8256 100644 --- a/build/images/openim-crontask/Dockerfile +++ b/build/images/openim-crontask/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-crontask + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-crontask -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-crontask /usr/bin/openim-crontask +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-crontask: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-crontask ./bin/openim-crontask +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-crontask"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msggateway/Dockerfile b/build/images/openim-msggateway/Dockerfile index d3a8694eda..31c26e7d45 100644 --- a/build/images/openim-msggateway/Dockerfile +++ b/build/images/openim-msggateway/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-msggateway + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-msggateway -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-msggateway /usr/bin/openim-msggateway +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-msggateway: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-msggateway ./bin/openim-msggateway +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-msggateway"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msgtransfer/Dockerfile b/build/images/openim-msgtransfer/Dockerfile index f949786488..602037fa13 100644 --- a/build/images/openim-msgtransfer/Dockerfile +++ b/build/images/openim-msgtransfer/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-msgtransfer + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-msgtransfer -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-msgtransfer /usr/bin/openim-msgtransfer +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-msgtransfer: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-msgtransfer ./bin/openim-msgtransfer +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-msgtransfer"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-push/Dockerfile b/build/images/openim-push/Dockerfile index faebbe9c05..b5973b4a53 100644 --- a/build/images/openim-push/Dockerfile +++ b/build/images/openim-push/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-push + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-push -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-push /usr/bin/openim-push +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-push: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-push ./bin/openim-push +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-push"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-auth/Dockerfile b/build/images/openim-rpc-auth/Dockerfile index 1e905d4b2b..e6f16553eb 100644 --- a/build/images/openim-rpc-auth/Dockerfile +++ b/build/images/openim-rpc-auth/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-auth + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-auth -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-auth /usr/bin/openim-rpc-auth +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-auth: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-auth ./bin/openim-rpc-auth +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-auth"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-conversation/Dockerfile b/build/images/openim-rpc-conversation/Dockerfile index 5a69aa89f1..e90ebb9c2b 100644 --- a/build/images/openim-rpc-conversation/Dockerfile +++ b/build/images/openim-rpc-conversation/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-conversation + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-conversation -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-conversation /usr/bin/openim-rpc-conversation +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-conversation: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-conversation ./bin/openim-rpc-conversation +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-conversation"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-friend/Dockerfile b/build/images/openim-rpc-friend/Dockerfile index fad21a880f..d481300915 100644 --- a/build/images/openim-rpc-friend/Dockerfile +++ b/build/images/openim-rpc-friend/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-friend + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-friend -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-friend /usr/bin/openim-rpc-friend +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-friend: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-friend ./bin/openim-rpc-friend +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-friend"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-group/Dockerfile b/build/images/openim-rpc-group/Dockerfile index d7dede6b9f..6d627c1e68 100644 --- a/build/images/openim-rpc-group/Dockerfile +++ b/build/images/openim-rpc-group/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-group + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-group -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-group /usr/bin/openim-rpc-group +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-group: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-group ./bin/openim-rpc-group +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-group"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-msg/Dockerfile b/build/images/openim-rpc-msg/Dockerfile index 71ad85f378..fc372dc1e8 100644 --- a/build/images/openim-rpc-msg/Dockerfile +++ b/build/images/openim-rpc-msg/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-msg + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-msg -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-msg /usr/bin/openim-rpc-msg +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-msg: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-msg ./bin/openim-rpc-msg +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-msg"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-third/Dockerfile b/build/images/openim-rpc-third/Dockerfile index 3560ad0d75..bcfb37f83f 100644 --- a/build/images/openim-rpc-third/Dockerfile +++ b/build/images/openim-rpc-third/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-third + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-third -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-third /usr/bin/openim-rpc-third +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-third: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-third ./bin/openim-rpc-third +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-third"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-user/Dockerfile b/build/images/openim-rpc-user/Dockerfile index a9891ece80..c02e538fc8 100644 --- a/build/images/openim-rpc-user/Dockerfile +++ b/build/images/openim-rpc-user/Dockerfile @@ -1,44 +1,60 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 + +ENV BINS=openim-rpc-user + +# Optionally build your application if needed +RUN mage build ${BINS} check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -RUN make build BINS=openim-rpc-user -RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-rpc-user /usr/bin/openim-rpc-user +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +RUN echo -e "serviceBinaries:\n openim-rpc-user: 1 \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -COPY --from=builder /usr/bin/openim-rpc-user ./bin/openim-rpc-user +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["./bin/openim-rpc-user"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-tools/component/Dockerfile b/build/images/openim-tools/component/Dockerfile index 6bdfa69422..6669f6e12b 100644 --- a/build/images/openim-tools/component/Dockerfile +++ b/build/images/openim-tools/component/Dockerfile @@ -1,48 +1,111 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# Set go mod installation source and proxy - -FROM golang:1.20 AS builder +# # Copyright © 2023 OpenIM. All rights reserved. +# # +# # Licensed under the Apache License, Version 2.0 (the "License"); +# # you may not use this file except in compliance with the License. +# # You may obtain a copy of the License at +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # Unless required by applicable law or agreed to in writing, software +# # distributed under the License is distributed on an "AS IS" BASIS, +# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# # See the License for the specific language governing permissions and +# # limitations under the License. + +# # OpenIM base image: https://github.com/openim-sigs/openim-base-image + +# # Set go mod installation source and proxy + +# FROM golang:1.20 AS builder + +# ARG GO111MODULE=on + +# WORKDIR /openim/openim-server + +# ENV GO111MODULE=$GO111MODULE +# ENV GOPROXY=$GOPROXY + +# COPY go.mod go.sum ./ +# RUN go mod download + +# COPY . . + +# RUN make clean +# RUN make build BINS=component + +# # FROM ghcr.io/openim-sigs/openim-bash-image:latest +# FROM ghcr.io/openim-sigs/openim-bash-image:latest + +# WORKDIR /openim/openim-server + +# COPY --from=builder /openim/openim-server/_output/bin/tools /openim/openim-server/_output/bin/tools/ +# COPY --from=builder /openim/openim-server/config /openim/openim-server/config + +# ENV OPENIM_SERVER_CONFIG_NAME=/openim/openim-server/config + +# RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/component /usr/bin/component + +# ENTRYPOINT ["bash", "-c", "component -c $OPENIM_SERVER_CONFIG_NAME"] + + +# Use Go 1.22 Alpine as the base image for building the application +FROM golang:1.22-alpine AS builder ARG GO111MODULE=on -WORKDIR /openim/openim-server +# Define the base directory for the application as an environment variable +ENV SERVER_DIR=/openim-server +# Set the working directory inside the container based on the environment variable +WORKDIR $SERVER_DIR + +# Set the Go proxy to improve dependency resolution speed ENV GO111MODULE=$GO111MODULE -ENV GOPROXY=$GOPROXY +ENV GOPROXY=https://goproxy.io,direct + +# Copy all files from the current directory into the container +COPY . . -COPY go.mod go.sum ./ RUN go mod download -COPY . . +# Install Mage to use for building the application +RUN go install github.com/magefile/mage@v1.15.0 -RUN make clean -RUN make build BINS=component +# ENV BINS=openim-rpc-user + +# Optionally build your application if needed +# RUN mage build ${BINS} check-free-memory seq || true +RUN mage build check-free-memory seq || true + +# Using Alpine Linux with Go environment for the final image +FROM golang:1.22-alpine + +# Install necessary packages, such as bash +RUN apk add bash + +# Set the environment and work directory +ENV SERVER_DIR=/openim-server +WORKDIR $SERVER_DIR -# FROM ghcr.io/openim-sigs/openim-bash-image:latest -FROM ghcr.io/openim-sigs/openim-bash-image:latest -WORKDIR /openim/openim-server +# Copy the compiled binaries and mage from the builder image to the final image +COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output +COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config +COPY --from=builder /go/bin/mage /usr/local/bin/mage +COPY --from=builder $SERVER_DIR/magefile_windows.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile_unix.go $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/magefile.go $SERVER_DIR/ +# COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ +COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -COPY --from=builder /openim/openim-server/_output/bin/tools /openim/openim-server/_output/bin/tools/ -COPY --from=builder /openim/openim-server/config /openim/openim-server/config -ENV OPENIM_SERVER_CONFIG_NAME=/openim/openim-server/config +RUN echo -e "serviceBinaries:\n \n" \ + > $SERVER_DIR/start-config.yml && \ + echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ + echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN mv ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/component /usr/bin/component +RUN go get github.com/mo3et/openim-gomake@v0.0.74 -ENTRYPOINT ["bash", "-c", "component -c $OPENIM_SERVER_CONFIG_NAME"] +# Set the command to run when the container starts +ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From dc4809858506f9f6105424c9fdf48ccfaee909d2 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 12 Nov 2024 18:35:05 +0800 Subject: [PATCH 03/33] rename seq file. --- tools/seq/internal/{main.go => seq.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/seq/internal/{main.go => seq.go} (100%) diff --git a/tools/seq/internal/main.go b/tools/seq/internal/seq.go similarity index 100% rename from tools/seq/internal/main.go rename to tools/seq/internal/seq.go From 201f1f009e6e06c92587fc1030090658c5e59787 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 12:28:21 +0800 Subject: [PATCH 04/33] build: update k8s origin deploys. --- deployments/deploy/README.md | 73 ++ deployments/deploy/ingress.yml | 25 + deployments/deploy/kafka-service.yml | 20 + deployments/deploy/kafka-statefulset.yml | 104 ++ deployments/deploy/minio-service.yml | 18 + deployments/deploy/minio-statefulset.yml | 89 ++ deployments/deploy/mongo-service.yml | 13 + deployments/deploy/mongo-statefulset.yml | 82 ++ deployments/deploy/notification-config.yml | 334 +++++ deployments/deploy/openim-api-deployment.yml | 34 + deployments/deploy/openim-api-service.yml | 17 + deployments/deploy/openim-config.yml | 1124 +++++++++++++++++ .../deploy/openim-crontask-deployment.yml | 30 + .../deploy/openim-msggateway-deployment.yml | 33 + .../deploy/openim-msggateway-service.yml | 17 + .../deploy/openim-msgtransfer-deployment.yml | 33 + .../deploy/openim-msgtransfer-service.yml | 14 + deployments/deploy/openim-push-deployment.yml | 40 + deployments/deploy/openim-push-service.yml | 17 + .../deploy/openim-rpc-auth-deployment.yml | 34 + .../deploy/openim-rpc-auth-service.yml | 17 + .../openim-rpc-conversation-deployment.yml | 41 + .../openim-rpc-conversation-service.yml | 17 + .../deploy/openim-rpc-friend-deployment.yml | 46 + .../deploy/openim-rpc-friend-service.yml | 17 + .../deploy/openim-rpc-group-deployment.yml | 41 + .../deploy/openim-rpc-group-service.yml | 17 + .../deploy/openim-rpc-msg-deployment.yml | 41 + deployments/deploy/openim-rpc-msg-service.yml | 17 + .../deploy/openim-rpc-third-deployment.yml | 51 + .../deploy/openim-rpc-third-service.yml | 17 + .../deploy/openim-rpc-user-deployment.yml | 41 + .../deploy/openim-rpc-user-service.yml | 17 + deployments/deploy/prometheus-config.yml | 112 ++ deployments/deploy/redis-service.yml | 15 + deployments/deploy/redis-statefulset.yml | 66 + 36 files changed, 2724 insertions(+) create mode 100644 deployments/deploy/README.md create mode 100644 deployments/deploy/ingress.yml create mode 100644 deployments/deploy/kafka-service.yml create mode 100644 deployments/deploy/kafka-statefulset.yml create mode 100644 deployments/deploy/minio-service.yml create mode 100644 deployments/deploy/minio-statefulset.yml create mode 100644 deployments/deploy/mongo-service.yml create mode 100644 deployments/deploy/mongo-statefulset.yml create mode 100644 deployments/deploy/notification-config.yml create mode 100644 deployments/deploy/openim-api-deployment.yml create mode 100644 deployments/deploy/openim-api-service.yml create mode 100644 deployments/deploy/openim-config.yml create mode 100644 deployments/deploy/openim-crontask-deployment.yml create mode 100644 deployments/deploy/openim-msggateway-deployment.yml create mode 100644 deployments/deploy/openim-msggateway-service.yml create mode 100644 deployments/deploy/openim-msgtransfer-deployment.yml create mode 100644 deployments/deploy/openim-msgtransfer-service.yml create mode 100644 deployments/deploy/openim-push-deployment.yml create mode 100644 deployments/deploy/openim-push-service.yml create mode 100644 deployments/deploy/openim-rpc-auth-deployment.yml create mode 100644 deployments/deploy/openim-rpc-auth-service.yml create mode 100644 deployments/deploy/openim-rpc-conversation-deployment.yml create mode 100644 deployments/deploy/openim-rpc-conversation-service.yml create mode 100644 deployments/deploy/openim-rpc-friend-deployment.yml create mode 100644 deployments/deploy/openim-rpc-friend-service.yml create mode 100644 deployments/deploy/openim-rpc-group-deployment.yml create mode 100644 deployments/deploy/openim-rpc-group-service.yml create mode 100644 deployments/deploy/openim-rpc-msg-deployment.yml create mode 100644 deployments/deploy/openim-rpc-msg-service.yml create mode 100644 deployments/deploy/openim-rpc-third-deployment.yml create mode 100644 deployments/deploy/openim-rpc-third-service.yml create mode 100644 deployments/deploy/openim-rpc-user-deployment.yml create mode 100644 deployments/deploy/openim-rpc-user-service.yml create mode 100644 deployments/deploy/prometheus-config.yml create mode 100644 deployments/deploy/redis-service.yml create mode 100644 deployments/deploy/redis-statefulset.yml diff --git a/deployments/deploy/README.md b/deployments/deploy/README.md new file mode 100644 index 0000000000..874a339765 --- /dev/null +++ b/deployments/deploy/README.md @@ -0,0 +1,73 @@ +# Kubernetes Deployment + +## Origin Deploy + +## First, Deployment All config and services + +1. Enter the target dir +`cd ./deployments/deploy/` + +2. Deploy configs and dependencies + +Apply all config and dependencies +`kubectl apply -f ./openim-config.yml -f ./notification-config.yml -f ./kafka-service.yml` + +Run infrasturcture components. + +`kubectl apply -f minio-service.yml -f minio-statefulset.yml -f mongo-service.yml -f mongo-statefulset.yml -f redis-service.yml -f redis-statefulset.yml -f kafka-service.yml -f kafka-statefulset.yml` + +>Note: Ensure that infrastructure services like MinIO, Redis, and Kafka are running before deploying the main applications. + + +Final, run all deployments and services + +```bash +kubectl apply \ + -f openim-api-deployment.yml \ + -f openim-api-service.yml \ + -f openim-crontask-deployment.yml \ + -f openim-rpc-user-deployment.yml \ + -f openim-rpc-user-service.yml \ + -f openim-msggateway-deployment.yml \ + -f openim-msggateway-service.yml \ + -f openim-push-deployment.yml \ + -f openim-push-service.yml \ + -f openim-msgtransfer-service.yml \ + -f openim-msgtransfer-deployment.yml \ + -f openim-rpc-conversation-deployment.yml \ + -f openim-rpc-conversation-service.yml \ + -f openim-rpc-auth-deployment.yml \ + -f openim-rpc-auth-service.yml \ + -f openim-rpc-group-deployment.yml \ + -f openim-rpc-group-service.yml \ + -f openim-rpc-friend-deployment.yml \ + -f openim-rpc-friend-service.yml \ + -f openim-rpc-msg-deployment.yml \ + -f openim-rpc-msg-service.yml \ + -f openim-rpc-third-deployment.yml \ + -f openim-rpc-third-service.yml +``` + +4. Verification +After deploying the services, verify that everything is running smoothly: + +```bash +# Check the status of all pods +kubectl get pods + +# Check the status of services +kubectl get svc + +# Check the status of deployments +kubectl get deployments + +# View all resources +kubectl get all +``` + +5. clean all + +`kubectl delete -f ./` + +### Notes: +- If you use a specific namespace for your deployment, be sure to append the -n flag to your kubectl commands. \ No newline at end of file diff --git a/deployments/deploy/ingress.yml b/deployments/deploy/ingress.yml new file mode 100644 index 0000000000..8a4fbaa024 --- /dev/null +++ b/deployments/deploy/ingress.yml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: openim-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + ingressClassName: openim-nginx + rules: + - http: + paths: + - path: /openim-api + pathType: Prefix + backend: + service: + name: openim-api-service + port: + number: 10002 + - path: /openim-msggateway + pathType: Prefix + backend: + service: + name: openim-msggateway-service + port: + number: 10001 diff --git a/deployments/deploy/kafka-service.yml b/deployments/deploy/kafka-service.yml new file mode 100644 index 0000000000..675600b989 --- /dev/null +++ b/deployments/deploy/kafka-service.yml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: kafka-service + labels: + app: kafka +spec: + ports: + - name: plaintext + port: 9092 + targetPort: 9092 + - name: controller + port: 9093 + targetPort: 9093 + - name: external + port: 19094 + targetPort: 9094 + selector: + app: kafka + type: ClusterIP diff --git a/deployments/deploy/kafka-statefulset.yml b/deployments/deploy/kafka-statefulset.yml new file mode 100644 index 0000000000..27821bb690 --- /dev/null +++ b/deployments/deploy/kafka-statefulset.yml @@ -0,0 +1,104 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: kafka-statefulset + labels: + app: kafka +spec: + replicas: 1 + selector: + matchLabels: + app: kafka + serviceName: "kafka-service" + template: + metadata: + labels: + app: kafka + spec: + containers: + - name: kafka + image: bitnami/kafka:3.5.1 + imagePullPolicy: IfNotPresent + resources: + limits: + memory: "2Gi" + cpu: "1000m" + requests: + memory: "1Gi" + cpu: "500m" + ports: + - containerPort: 9092 # PLAINTEXT + - containerPort: 9093 # CONTROLLER + - containerPort: 9094 # EXTERNAL + # command: + # - /bin/bash + # - "-c" + # - | + # # /opt/bitnami/scripts/kafka/run.sh & /opt/bitnami/kafka/create-topic.sh; wait + # # /opt/bitnami/scripts/kafka/entrypoint.sh && /opt/bitnami/scripts/kafka/setup.sh && /opt/bitnami/scripts/kafka/run.sh + # & while ! echo > /dev/tcp/localhost/9092; do + # echo "Waiting for Kafka to start..." + # sleep 5 + # done + # /opt/bitnami/kafka/create-topic.sh + # tail -f /dev/null + env: + - name: TZ + value: "Asia/Shanghai" + - name: KAFKA_CFG_NODE_ID + value: "0" + - name: KAFKA_CFG_PROCESS_ROLES + value: "controller,broker" + - name: KAFKA_CFG_CONTROLLER_QUORUM_VOTERS + value: "0@kafka-service:9093" + - name: KAFKA_CFG_LISTENERS + value: "PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094" + - name: KAFKA_CFG_ADVERTISED_LISTENERS + value: "PLAINTEXT://kafka-service:9092,EXTERNAL://kafka-service:19094" + - name: KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP + value: "CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT" + - name: KAFKA_CFG_CONTROLLER_LISTENER_NAMES + value: "CONTROLLER" + volumeMounts: + - name: kafka-data + mountPath: /bitnami/kafka + - name: kafka-scripts + mountPath: /opt/bitnami/kafka/create-topic.sh + subPath: create-topic.sh + - name: create-topics + image: bitnami/kafka:3.5.1 + command: + - /bin/bash + - "-c" + - | + /opt/bitnami/kafka/create-topic.sh && \ + tail -f /dev/null + volumeMounts: + - name: kafka-scripts + mountPath: /opt/bitnami/kafka/create-topic.sh + subPath: create-topic.sh + - name: kafka-data + mountPath: /bitnami/kafka + volumes: + - name: kafka-scripts + configMap: + name: openim-config + defaultMode: 0755 + items: + - key: create-topic.sh + path: create-topic.sh + - name: kafka-data + persistentVolumeClaim: + claimName: kafka-pvc + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: kafka-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/deployments/deploy/minio-service.yml b/deployments/deploy/minio-service.yml new file mode 100644 index 0000000000..1aeeb5f6cc --- /dev/null +++ b/deployments/deploy/minio-service.yml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: minio-service +spec: + selector: + app: minio + ports: + - name: minio + protocol: TCP + port: 10005 # External port for accessing MinIO service + targetPort: 9000 # Container port for MinIO service + - name: minio-console + protocol: TCP + port: 19090 # External port for accessing MinIO console + targetPort: 9090 # Container port for MinIO console + type: NodePort diff --git a/deployments/deploy/minio-statefulset.yml b/deployments/deploy/minio-statefulset.yml new file mode 100644 index 0000000000..f7028d8efe --- /dev/null +++ b/deployments/deploy/minio-statefulset.yml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minio + labels: + app: minio +spec: + replicas: 1 + selector: + matchLabels: + app: minio + template: + metadata: + labels: + app: minio + spec: + containers: + - name: minio + image: minio/minio:RELEASE.2024-01-11T07-46-16Z + imagePullPolicy: IfNotPresent + ports: + - containerPort: 9000 # MinIO service port + - containerPort: 9090 # MinIO console port + volumeMounts: + - name: minio-data + mountPath: /data + - name: minio-config + mountPath: /root/.minio + env: + - name: TZ + value: "Asia/Shanghai" + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: minio-secret + key: minio-root-user + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: minio-secret + key: minio-root-password + + command: + - minio + - server + - /data + - "--console-address" + - ":9090" + volumes: + - name: minio-data + persistentVolumeClaim: + claimName: minio-pvc + - name: minio-config + persistentVolumeClaim: + claimName: minio-config-pvc + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minio-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minio-config-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + +--- +apiVersion: v1 +kind: Secret +metadata: + name: minio-secret +type: Opaque +data: + minio-root-user: cm9vdA== # Base64 encoded "root" + minio-root-password: b3BlbklNMTIz # Base64 encoded "openIM123" diff --git a/deployments/deploy/mongo-service.yml b/deployments/deploy/mongo-service.yml new file mode 100644 index 0000000000..ea5a85203f --- /dev/null +++ b/deployments/deploy/mongo-service.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: mongo-service +spec: + selector: + app: mongo + ports: + - name: mongodb-port + protocol: TCP + port: 37017 + targetPort: 27017 + type: ClusterIP diff --git a/deployments/deploy/mongo-statefulset.yml b/deployments/deploy/mongo-statefulset.yml new file mode 100644 index 0000000000..2359cbce98 --- /dev/null +++ b/deployments/deploy/mongo-statefulset.yml @@ -0,0 +1,82 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: mongo-statefulset +spec: + serviceName: "mongo" + replicas: 1 + selector: + matchLabels: + app: mongo + template: + metadata: + labels: + app: mongo + spec: + containers: + - name: mongo + image: mongo:6.0.2 + command: + [ + "/bin/bash", + "-c", + "docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth & sleep 15; /scripts/mongo-init.sh; wait", + ] + ports: + - containerPort: 27017 + env: + - name: MONGO_INITDB_ROOT_USERNAME + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_initdb_root_username + - name: MONGO_INITDB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_initdb_root_password + - name: MONGO_INITDB_DATABASE + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_initdb_database + - name: MONGO_OPENIM_USERNAME + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_username + - name: MONGO_OPENIM_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password + volumeMounts: + - name: mongo-storage + mountPath: /data/db + - name: script-volume + mountPath: /scripts + # subPath: mongo-init.sh + + volumes: + - name: script-volume + configMap: + name: openim-config + items: + - key: mongo-init.sh + path: mongo-init.sh + mode: 0755 + - name: mongo-storage + persistentVolumeClaim: + claimName: mongo-pvc + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mongo-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi diff --git a/deployments/deploy/notification-config.yml b/deployments/deploy/notification-config.yml new file mode 100644 index 0000000000..0f45616b02 --- /dev/null +++ b/deployments/deploy/notification-config.yml @@ -0,0 +1,334 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: notification-config +data: + notification.yml: | + groupCreated: + isSendMsg: true + # Reliability level of the message sending. + # Set to 1 to send only when online, 2 for guaranteed delivery. + reliabilityLevel: 1 + # This setting is effective only when 'isSendMsg' is true. + # It controls whether to count unread messages. + unreadCount: false + # Configuration for offline push notifications. + offlinePush: + # Enables or disables offline push notifications. + enable: false + # Title for the notification when a group is created. + title: create group title + # Description for the notification. + desc: create group desc + # Additional information for the notification. + ext: create group ext + + groupInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSet title + desc: groupInfoSet desc + ext: groupInfoSet ext + + + joinGroupApplication: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: joinGroupApplication title + desc: joinGroupApplication desc + ext: joinGroupApplication ext + + memberQuit: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberQuit title + desc: memberQuit desc + ext: memberQuit ext + + groupApplicationAccepted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationAccepted title + desc: groupApplicationAccepted desc + ext: groupApplicationAccepted ext + + groupApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationRejected title + desc: groupApplicationRejected desc + ext: groupApplicationRejected ext + + + groupOwnerTransferred: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupOwnerTransferred title + desc: groupOwnerTransferred desc + ext: groupOwnerTransferred ext + + memberKicked: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberKicked title + desc: memberKicked desc + ext: memberKicked ext + + memberInvited: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberInvited title + desc: memberInvited desc + ext: memberInvited ext + + memberEnter: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberEnter title + desc: memberEnter desc + ext: memberEnter ext + + groupDismissed: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupDismissed title + desc: groupDismissed desc + ext: groupDismissed ext + + groupMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMuted title + desc: groupMuted desc + ext: groupMuted ext + + groupCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupCancelMuted title + desc: groupCancelMuted desc + ext: groupCancelMuted ext + defaultTips: + tips: group Cancel Muted + + + groupMemberMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberMuted title + desc: groupMemberMuted desc + ext: groupMemberMuted ext + + groupMemberCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberCancelMuted title + desc: groupMemberCancelMuted desc + ext: groupMemberCancelMuted ext + + groupMemberInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberInfoSet title + desc: groupMemberInfoSet desc + ext: groupMemberInfoSet ext + + groupInfoSetAnnouncement: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetAnnouncement title + desc: groupInfoSetAnnouncement desc + ext: groupInfoSetAnnouncement ext + + + groupInfoSetName: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetName title + desc: groupInfoSetName desc + ext: groupInfoSetName ext + + + #############################friend################################# + friendApplicationAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: Somebody applies to add you as a friend + desc: Somebody applies to add you as a friend + ext: Somebody applies to add you as a friend + + friendApplicationApproved: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone applies to add your friend application + desc: Someone applies to add your friend application + ext: Someone applies to add your friend application + + friendApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone rejected your friend application + desc: Someone rejected your friend application + ext: Someone rejected your friend application + + friendAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: We have become friends + desc: We have become friends + ext: We have become friends + + friendDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: deleted a friend + desc: deleted a friend + ext: deleted a friend + + friendRemarkSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Your friend's profile has been changed + desc: Your friend's profile has been changed + ext: Your friend's profile has been changed + + blackAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: blocked a user + desc: blocked a user + ext: blocked a user + + blackDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Remove a blocked user + desc: Remove a blocked user + ext: Remove a blocked user + + friendInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: friend info updated + desc: friend info updated + ext: friend info updated + + #####################user######################### + userInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: userInfo updated + desc: userInfo updated + ext: userInfo updated + + userStatusChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: user status changed + desc: user status changed + ext: user status changed + + #####################conversation######################### + conversationChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: conversation changed + desc: conversation changed + ext: conversation changed + + conversationSetPrivate: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: burn after reading + desc: burn after reading + ext: burn after reading diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml new file mode 100644 index 0000000000..981717156f --- /dev/null +++ b/deployments/deploy/openim-api-deployment.yml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openim-api +spec: + replicas: 1 + selector: + matchLabels: + app: openim-api + template: + metadata: + labels: + app: openim-api + spec: + containers: + - name: openim-api-container + image: op-api:v3.90 + # imagePullPolicy: Never + env: + - name: CONFIG_PATH + value: "/config" + - name: DEPLOYMENT_TYPE + value: "kubernetes" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + ports: + - containerPort: 10002 + - containerPort: 12002 + volumes: + - name: openim-config + configMap: + name: openim-config diff --git a/deployments/deploy/openim-api-service.yml b/deployments/deploy/openim-api-service.yml new file mode 100644 index 0000000000..468b5721f9 --- /dev/null +++ b/deployments/deploy/openim-api-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: openim-api-service +spec: + selector: + app: openim-api + ports: + - name: http-10302 + protocol: TCP + port: 10002 + targetPort: 10002 + - name: prometheus-20113 + protocol: TCP + port: 12002 + targetPort: 12002 + type: NodePort diff --git a/deployments/deploy/openim-config.yml b/deployments/deploy/openim-config.yml new file mode 100644 index 0000000000..30d683c127 --- /dev/null +++ b/deployments/deploy/openim-config.yml @@ -0,0 +1,1124 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: openim-config +data: + discovery.yml: | + enable: "kubernetes" + log.yml: | + # Log storage path, default is acceptable, change to a full path if modification is needed + # storageLocation: ../../../../logs/ + storageLocation: ./logs/ + # Log rotation period (in hours), default is acceptable + rotationTime: 24 + # Number of log files to retain, default is acceptable + remainRotationCount: 2 + # Log level settings: 3 for production environment; 6 for more verbose logging in debugging environments + remainLogLevel: 6 + # Whether to output to standard output, default is acceptable + isStdout: true + # Whether to log in JSON format, default is acceptable + isJson: false + # output simplify log when KeyAndValues's value len is bigger than 50 in rpc method log + isSimplify: true + mongodb.yml: | + # URI for database connection, leave empty if using address and credential settings directly + uri: '' + # List of MongoDB server addresses + address: [ mongo-service:37017 ] + # Name of the database + database: openim_v3 + # Username for database authentication + username: openIM + # Password for database authentication + password: openIM123 + # Maximum number of connections in the connection pool + maxPoolSize: 100 + # Maximum number of retry attempts for a failed database connection + maxRetry: 10 + local-cache.yml: | + user: + topic: DELETE_CACHE_USER + slotNum: 100 + slotSize: 2000 + successExpire: 300 + failedExpire: 5 + group: + topic: DELETE_CACHE_GROUP + slotNum: 100 + slotSize: 2000 + successExpire: 300 + failedExpire: 5 + friend: + topic: DELETE_CACHE_FRIEND + slotNum: 100 + slotSize: 2000 + successExpire: 300 + failedExpire: 5 + conversation: + topic: DELETE_CACHE_CONVERSATION + slotNum: 100 + slotSize: 2000 + successExpire: 300 + failedExpire: 5 + + openim-api.yml: | + secret: openIM123 + api: + # Listening IP; 0.0.0.0 means both internal and external IPs are listened to, default is recommended + listenIP: 0.0.0.0 + # Listening ports; if multiple are configured, multiple instances will be launched, must be consistent with the number of prometheus.ports + ports: [ 10002 ] + prometheus: + # Whether to enable prometheus + enable: true + # Prometheus listening ports, must match the number of api.ports + ports: [ 12002 ] + # This address can be accessed via a browser + grafanaURL: http://127.0.0.1:13000/ + openim-rpc-user.yml: | + rpc: + # API or other RPCs can access this RPC through this IP; if left blank, the internal network IP is obtained by default + registerIP: '' + # Listening IP; 0.0.0.0 means both internal and external IPs are listened to, if blank, the internal network IP is automatically obtained by default + listenIP: 0.0.0.0 + # Listening ports; if multiple are configured, multiple instances will be launched, and must be consistent with the number of prometheus.ports + ports: [ 10320 ] + prometheus: + # Whether to enable prometheus + enable: true + # Prometheus listening ports, must be consistent with the number of rpc.ports + ports: [ 12320 ] + + openim-crontask.yml: | + cronExecuteTime: 0 2 * * * + retainChatRecords: 365 + fileExpireTime: 90 + + openim-msggateway.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10140, 10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 10151, 10152, 10153, 10154, 10155 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12140, 12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 12152, 12153, 12154, 12155 ] + + # IP address that the RPC/WebSocket service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + + longConnSvr: + # WebSocket listening ports, must match the number of rpc.ports + ports: [ 10001 ] + # Maximum number of WebSocket connections + websocketMaxConnNum: 100000 + # Maximum length of the entire WebSocket message packet + websocketMaxMsgLen: 4096 + # WebSocket connection handshake timeout in seconds + websocketTimeout: 10 + + openim-msgtransfer.yml: | + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; each port corresponds to an instance of monitoring. Ensure these are managed accordingly + # Because four instances have been launched, four ports need to be specified + ports: [ 12020, 12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 12031, 12032, 12033, 12034, 12035 ] + + openim-push.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10170, 10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 10181, 10182, 10183, 10184, 10185 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12170, 12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12182, 12183, 12184, 12185, 12186 ] + + maxConcurrentWorkers: 3 + #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. + enable: geTui + geTui: + pushUrl: https://restapi.getui.com/v2/$appId + masterSecret: + appKey: + intent: + channelID: + channelName: + fcm: + # Prioritize using file paths. If the file path is empty, use URL + filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath. + authURL: # Must start with https or http. + jpns: + appKey: + masterSecret: + pushURL: + pushIntent: + + # iOS system push sound and badge count + iosPush: + pushSound: xxx + badgeCount: true + production: false + + fullUserCache: true + + openim-rpc-auth.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [10200] + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [12200] + tokenPolicy: + # Token validity period, in days + expire: 90 + + openim-rpc-conversation.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10220 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12220 ] + + openim-rpc-friend.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10240 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12240 ] + + openim-rpc-group.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10260 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12260 ] + + enableHistoryForNewMembers: true + + openim-rpc-msg.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10280 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12280 ] + + + # Does sending messages require friend verification + friendVerify: false + + openim-rpc-third.yml: | + rpc: + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + ports: [ 10300 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12300 ] + + + object: + # Use MinIO as object storage, or set to "cos", "oss", "kodo", "aws", while also configuring the corresponding settings + enable: minio + cos: + bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com + secretID: + secretKey: + sessionToken: + publicRead: false + oss: + endpoint: https://oss-cn-chengdu.aliyuncs.com + bucket: demo-9999999 + bucketURL: https://demo-9999999.oss-cn-chengdu.aliyuncs.com + accessKeyID: + accessKeySecret: + sessionToken: + publicRead: false + kodo: + endpoint: http://s3.cn-south-1.qiniucs.com + bucket: kodo-bucket-test + bucketURL: http://kodo-bucket-test-oetobfb.qiniudns.com + accessKeyID: + accessKeySecret: + sessionToken: + publicRead: false + + share.yml: | + secret: openIM123 + rpcRegisterName: + user: user-rpc-service:10320 + friend: friend-rpc-service:10240 + msg: msg-rpc-service:10280 + push: openim-push-service + messageGateway: openim-msggateway-service + group: group-rpc-service:10260 + auth: auth-rpc-service:10200 + conversation: conversation-rpc-service:10220 + third: third-rpc-service:10300 + + imAdminUserID: ["imAdmin"] + + # 1: For Android, iOS, Windows, Mac, and web platforms, only one instance can be online at a time + multiLogin: + policy: 1 + maxNumOneEnd: 30 + customizeLoginNum: + ios: 1 + android: 1 + windows: 1 + osx: 1 + web: 1 + miniWeb: 1 + linux: 1 + aPad: 1 + iPad: 1 + admin: 1 + + kafka.yml: | + username: '' + password: '' + producerAck: all + compressType: none + address: [ "kafka-service:19094" ] + toRedisTopic: toRedis + toMongoTopic: toMongo + toPushTopic: toPush + toOfflinePushTopic: toOfflinePush + toRedisGroupID: redis + toMongoGroupID: mongo + toPushGroupID: push + toOfflinePushGroupID: offlinePush + tls: + enableTLS: false + caCrt: + clientCrt: + clientKey: + clientKeyPwd: + insecureSkipVerify: false + redis.yml: | + address: [ "redis-service:16379" ] + username: + password: openIM123 + clusterMode: false + db: 0 + maxRetry: 10 + poolSize: 100 + minio.yml: | + # Name of the bucket in MinIO + bucket: openim + # Access key ID for MinIO authentication + accessKeyID: root # ${MINIO_ACCESS_KEY} + # Secret access key for MinIO authentication + secretAccessKey: openIM123 # ${MINIO_SECRET_KEY} + # Session token for MinIO authentication (optional) + sessionToken: "" + # Internal address of the MinIO server + internalAddress: minio-service:10005 + # External address of the MinIO server, accessible from outside. Supports both HTTP and HTTPS using a domain name + externalAddress: http://minio-service:10005 + # Flag to enable or disable public read access to the bucket + publicRead: "false" + + notification.yml: | + groupCreated: + isSendMsg: true + # Reliability level of the message sending. + # Set to 1 to send only when online, 2 for guaranteed delivery. + reliabilityLevel: 1 + # This setting is effective only when 'isSendMsg' is true. + # It controls whether to count unread messages. + unreadCount: false + # Configuration for offline push notifications. + offlinePush: + # Enables or disables offline push notifications. + enable: false + # Title for the notification when a group is created. + title: create group title + # Description for the notification. + desc: create group desc + # Additional information for the notification. + ext: create group ext + + groupInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSet title + desc: groupInfoSet desc + ext: groupInfoSet ext + + + joinGroupApplication: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: joinGroupApplication title + desc: joinGroupApplication desc + ext: joinGroupApplication ext + + memberQuit: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberQuit title + desc: memberQuit desc + ext: memberQuit ext + + groupApplicationAccepted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationAccepted title + desc: groupApplicationAccepted desc + ext: groupApplicationAccepted ext + + groupApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationRejected title + desc: groupApplicationRejected desc + ext: groupApplicationRejected ext + + + groupOwnerTransferred: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupOwnerTransferred title + desc: groupOwnerTransferred desc + ext: groupOwnerTransferred ext + + memberKicked: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberKicked title + desc: memberKicked desc + ext: memberKicked ext + + memberInvited: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberInvited title + desc: memberInvited desc + ext: memberInvited ext + + memberEnter: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberEnter title + desc: memberEnter desc + ext: memberEnter ext + + groupDismissed: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupDismissed title + desc: groupDismissed desc + ext: groupDismissed ext + + groupMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMuted title + desc: groupMuted desc + ext: groupMuted ext + + groupCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupCancelMuted title + desc: groupCancelMuted desc + ext: groupCancelMuted ext + defaultTips: + tips: group Cancel Muted + + + groupMemberMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberMuted title + desc: groupMemberMuted desc + ext: groupMemberMuted ext + + groupMemberCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberCancelMuted title + desc: groupMemberCancelMuted desc + ext: groupMemberCancelMuted ext + + groupMemberInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberInfoSet title + desc: groupMemberInfoSet desc + ext: groupMemberInfoSet ext + + groupInfoSetAnnouncement: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetAnnouncement title + desc: groupInfoSetAnnouncement desc + ext: groupInfoSetAnnouncement ext + + + groupInfoSetName: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetName title + desc: groupInfoSetName desc + ext: groupInfoSetName ext + + + #############################friend################################# + friendApplicationAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: Somebody applies to add you as a friend + desc: Somebody applies to add you as a friend + ext: Somebody applies to add you as a friend + + friendApplicationApproved: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone applies to add your friend application + desc: Someone applies to add your friend application + ext: Someone applies to add your friend application + + friendApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone rejected your friend application + desc: Someone rejected your friend application + ext: Someone rejected your friend application + + friendAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: We have become friends + desc: We have become friends + ext: We have become friends + + friendDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: deleted a friend + desc: deleted a friend + ext: deleted a friend + + friendRemarkSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Your friend's profile has been changed + desc: Your friend's profile has been changed + ext: Your friend's profile has been changed + + blackAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: blocked a user + desc: blocked a user + ext: blocked a user + + blackDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Remove a blocked user + desc: Remove a blocked user + ext: Remove a blocked user + + friendInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: friend info updated + desc: friend info updated + ext: friend info updated + + #####################user######################### + userInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: userInfo updated + desc: userInfo updated + ext: userInfo updated + + userStatusChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: user status changed + desc: user status changed + ext: user status changed + + #####################conversation######################### + conversationChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: conversation changed + desc: conversation changed + ext: conversation changed + + conversationSetPrivate: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: burn after reading + desc: burn after reading + ext: burn after reading + + prometheus.yml: | + # my global config + global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Alertmanager configuration + alerting: + alertmanagers: + - static_configs: + - targets: [internal_ip:19093] + + # Load rules once and periodically evaluate them according to the global evaluation_interval. + rule_files: + - instance-down-rules.yml + # - first_rules.yml + # - second_rules.yml + + # A scrape configuration containing exactly one endpoint to scrape: + # Here it's Prometheus itself. + scrape_configs: + # The job name is added as a label "job=job_name" to any timeseries scraped from this config. + # Monitored information captured by prometheus + + # prometheus fetches application services + - job_name: node_exporter + static_configs: + - targets: [internal_ip:20500] + - job_name: openimserver-openim-api + static_configs: + - targets: [internal_ip:12002] + labels: + namespace: default + - job_name: openimserver-openim-msggateway + static_configs: + - targets: [internal_ip:12140] + # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] + labels: + namespace: default + - job_name: openimserver-openim-msgtransfer + static_configs: + - targets: + [ + internal_ip:12020, + internal_ip:12021, + internal_ip:12022, + internal_ip:12023, + internal_ip:12024, + internal_ip:12025, + internal_ip:12026, + internal_ip:12027, + ] + # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] + labels: + namespace: default + - job_name: openimserver-openim-push + static_configs: + - targets: + [ + internal_ip:12170, + internal_ip:12171, + internal_ip:12172, + internal_ip:12173, + internal_ip:12174, + internal_ip:12175, + internal_ip:12176, + internal_ip:12177, + ] + # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-auth + static_configs: + - targets: [internal_ip:12200] + labels: + namespace: default + - job_name: openimserver-openim-rpc-conversation + static_configs: + - targets: [internal_ip:12220] + labels: + namespace: default + - job_name: openimserver-openim-rpc-friend + static_configs: + - targets: [internal_ip:12240] + labels: + namespace: default + - job_name: openimserver-openim-rpc-group + static_configs: + - targets: [internal_ip:12260] + labels: + namespace: default + - job_name: openimserver-openim-rpc-msg + static_configs: + - targets: [internal_ip:12280] + labels: + namespace: default + - job_name: openimserver-openim-rpc-third + static_configs: + - targets: [internal_ip:12300] + labels: + namespace: default + - job_name: openimserver-openim-rpc-user + static_configs: + - targets: [internal_ip:12320] + labels: + namespace: default + + mongo-init.sh: | + echo "before running mongosh..." + mongosh < 0) { + try { + print('Attempting to connect to MongoDB. Remaining retries: ' + maxRetries); + db = connect('mongodb://127.0.0.1:27017/admin'); + var authResult = db.auth(rootUsername, rootPassword); + if (authResult) { + print('Authentication successful for root user: ' + rootUsername); + connected = true; + } else { + print('Authentication failed for root user: ' + rootUsername + ' with password: ' + rootPassword); + quit(1); + } + } catch (e) { + maxRetries--; + print('Connection failed due to error: ' + e); + print('Retrying... Remaining attempts: ' + maxRetries); + sleep(1000); // Sleep for 1 second + } + } + + if (connected) { + print('Connected to MongoDB successfully. Proceeding to create user...'); + db = db.getSiblingDB(dbName); + var createUserResult = db.createUser({ + user: openimUsername, + pwd: openimPassword, + roles: [{ + role: 'readWrite', + db: dbName + }] + }); + + if (createUserResult.ok == 1) { + print('User creation successful. User: ' + openimUsername + ', Database: ' + dbName); + } else { + print('User creation failed for user: ' + openimUsername + ' in database: ' + dbName); + quit(1); + } + } else { + print('Failed to connect to MongoDB after 300 retries.'); + quit(1); + } + + print('Script execution completed.'); + EOF + echo "mongosh completed..." + + create-topic.sh: | + #!/usr/bin/env bash + # Wait for Kafka to be ready + + KAFKA_SERVER=kafka-service:9092 + + MAX_ATTEMPTS=300 + attempt_num=1 + + echo "Waiting for Kafka to be ready..." + + until /opt/bitnami/kafka/bin/kafka-topics.sh --list --bootstrap-server $KAFKA_SERVER; do + echo "Attempt $attempt_num of $MAX_ATTEMPTS: Kafka not ready yet..." + if [ $attempt_num -eq $MAX_ATTEMPTS ]; then + echo "Kafka not ready after $MAX_ATTEMPTS attempts, exiting" + exit 1 + fi + attempt_num=$((attempt_num+1)) + sleep 1 + done + + echo "Kafka is ready. Creating topics..." + + + topics=("toRedis" "toMongo" "toPush" "toOfflinePush") + partitions=8 + replicationFactor=1 + + for topic in "${topics[@]}"; do + if /opt/bitnami/kafka/bin/kafka-topics.sh --create \ + --bootstrap-server $KAFKA_SERVER \ + --replication-factor $replicationFactor \ + --partitions $partitions \ + --topic $topic + then + echo "Topic $topic created." + else + echo "Failed to create topic $topic." + fi + done + + echo "All topics created." + + webhooks.yml: | + url: http://127.0.0.1:10006/callbackExample + beforeSendSingleMsg: + enable: false + timeout: 5 + failedContinue: true + # Only the contentType in allowedTypes will send the callback. + # Supports two formats: a single type or a range. The range is defined by the lower and upper bounds connected with a hyphen ("-"). + # e.g. allowedTypes: [1, 100, 200-500, 600-700] means that only contentType within the range + # {1, 100} ∪ [200, 500] ∪ [600, 700] will be allowed through the filter. + # If not set, all contentType messages will through this filter. + allowedTypes: [] + # Only the contentType not in deniedTypes will send the callback. + # Supports two formats, same as allowedTypes. + # If not set, all contentType messages will through this filter. + deniedTypes: [] + beforeUpdateUserInfoEx: + enable: false + timeout: 5 + failedContinue: true + afterUpdateUserInfoEx: + enable: false + timeout: 5 + afterSendSingleMsg: + enable: false + timeout: 5 + # Only the senID/recvID specified in attentionIds will send the callback + # if not set, all user messages will be callback + attentionIds: [] + # See beforeSendSingleMsg comment. + allowedTypes: [] + deniedTypes: [] + beforeSendGroupMsg: + enable: false + timeout: 5 + failedContinue: true + # See beforeSendSingleMsg comment. + allowedTypes: [] + deniedTypes: [] + beforeMsgModify: + enable: false + timeout: 5 + failedContinue: true + # See beforeSendSingleMsg comment. + allowedTypes: [] + deniedTypes: [] + afterSendGroupMsg: + enable: false + timeout: 5 + # See beforeSendSingleMsg comment. + allowedTypes: [] + deniedTypes: [] + afterUserOnline: + enable: false + timeout: 5 + afterUserOffline: + enable: false + timeout: 5 + afterUserKickOff: + enable: false + timeout: 5 + beforeOfflinePush: + enable: false + timeout: 5 + failedContinue: true + beforeOnlinePush: + enable: false + timeout: 5 + failedContinue: true + beforeGroupOnlinePush: + enable: false + timeout: 5 + failedContinue: true + beforeAddFriend: + enable: false + timeout: 5 + failedContinue: true + beforeUpdateUserInfo: + enable: false + timeout: 5 + failedContinue: true + afterUpdateUserInfo: + enable: false + timeout: 5 + beforeCreateGroup: + enable: false + timeout: 5 + failedContinue: true + afterCreateGroup: + enable: false + timeout: 5 + beforeMemberJoinGroup: + enable: false + timeout: 5 + failedContinue: true + beforeSetGroupMemberInfo: + enable: false + timeout: 5 + failedContinue: true + afterSetGroupMemberInfo: + enable: false + timeout: 5 + afterQuitGroup: + enable: false + timeout: 5 + afterKickGroupMember: + enable: false + timeout: 5 + afterDismissGroup: + enable: false + timeout: 5 + beforeApplyJoinGroup: + enable: false + timeout: 5 + failedContinue: true + afterGroupMsgRead: + enable: false + timeout: 5 + afterSingleMsgRead: + enable: false + timeout: 5 + beforeUserRegister: + enable: false + timeout: 5 + failedContinue: true + afterUserRegister: + enable: false + timeout: 5 + afterTransferGroupOwner: + enable: false + timeout: 5 + beforeSetFriendRemark: + enable: false + timeout: 5 + failedContinue: true + afterSetFriendRemark: + enable: false + timeout: 5 + afterGroupMsgRevoke: + enable: false + timeout: 5 + afterJoinGroup: + enable: false + timeout: 5 + beforeInviteUserToGroup: + enable: false + timeout: 5 + failedContinue: true + afterSetGroupInfo: + enable: false + timeout: 5 + beforeSetGroupInfo: + enable: false + timeout: 5 + failedContinue: true + afterSetGroupInfoEx: + enable: false + timeout: 5 + beforeSetGroupInfoEx: + enable: false + timeout: 5 + failedContinue: true + afterRevokeMsg: + enable: false + timeout: 5 + beforeAddBlack: + enable: false + timeout: 5 + failedContinue: + afterAddFriend: + enable: false + timeout: 5 + beforeAddFriendAgree: + enable: false + timeout: 5 + failedContinue: true + afterAddFriendAgree: + enable: false + timeout: 5 + afterDeleteFriend: + enable: false + timeout: 5 + beforeImportFriends: + enable: false + timeout: 5 + failedContinue: true + afterImportFriends: + enable: false + timeout: 5 + afterRemoveBlack: + enable: false + timeout: 5 + +--- +apiVersion: v1 +kind: Secret +metadata: + name: mongo-secret +type: Opaque +data: + mongo_initdb_root_username: cm9vdA== # base64 for "root" + mongo_initdb_root_password: b3BlbklNMTIz # base64 for "openIM123" + mongo_initdb_database: b3BlbmltX3Yz # base64 for "openim_v3" + mongo_openim_username: b3BlbklN # base64 for "openIM" + mongo_openim_password: b3BlbklNMTIz # base64 for "openIM123" diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml new file mode 100644 index 0000000000..969837de45 --- /dev/null +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openim-crontask +spec: + replicas: 1 + selector: + matchLabels: + app: crontask + template: + metadata: + labels: + app: crontask + spec: + containers: + - name: crontask-container + image: op-crontask:v3.9 + env: + - name: CONFIG_PATH + value: "/config" + - name: DEPLOYMENT_TYPE + value: "kubernetes" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + volumes: + - name: openim-config + configMap: + name: openim-config diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml new file mode 100644 index 0000000000..1c0a1d43c0 --- /dev/null +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openim-msggateway-server +spec: + replicas: 1 + selector: + matchLabels: + app: openim-msggateway-server + template: + metadata: + labels: + app: openim-msggateway-server + spec: + containers: + - name: openim-msggateway-container + image: op-msggateway:v3.9 + env: + - name: CONFIG_PATH + value: "/config" + - name: DEPLOYMENT_TYPE + value: "kubernetes" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + ports: + - containerPort: 10001 + - containerPort: 12001 + volumes: + - name: openim-config + configMap: + name: openim-config diff --git a/deployments/deploy/openim-msggateway-service.yml b/deployments/deploy/openim-msggateway-service.yml new file mode 100644 index 0000000000..25af48c886 --- /dev/null +++ b/deployments/deploy/openim-msggateway-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: openim-msggateway-service +spec: + selector: + app: openim-msggateway-server + ports: + - name: http-10001 + protocol: TCP + port: 10001 + targetPort: 10001 + - name: prometheus-12001 + protocol: TCP + port: 12001 + targetPort: 12001 + type: NodePort diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml new file mode 100644 index 0000000000..ccc0f64712 --- /dev/null +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openim-msgtransfer-server +spec: + replicas: 1 + selector: + matchLabels: + app: openim-msgtransfer-server + template: + metadata: + labels: + app: openim-msgtransfer-server + spec: + containers: + - name: openim-msgtransfer-container + image: op-msgtransfer:v3.9 + env: + - name: CONFIG_PATH + value: "/config" + - name: DEPLOYMENT_TYPE + value: "kubernetes" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + ports: + # - containerPort: 15200 + - containerPort: 12020 + volumes: + - name: openim-config + configMap: + name: openim-config diff --git a/deployments/deploy/openim-msgtransfer-service.yml b/deployments/deploy/openim-msgtransfer-service.yml new file mode 100644 index 0000000000..a2eafd39fb --- /dev/null +++ b/deployments/deploy/openim-msgtransfer-service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: openim-msgtransfer-service +spec: + selector: + app: openim-msgtransfer-server + ports: + # TODO Need check port!!! + - name: prometheus-12020 + protocol: TCP + port: 12020 + targetPort: 12020 + type: ClusterIP diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml new file mode 100644 index 0000000000..06c44b60cd --- /dev/null +++ b/deployments/deploy/openim-push-deployment.yml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: openim-push-server +spec: + replicas: 1 + selector: + matchLabels: + app: openim-push-server + template: + metadata: + labels: + app: openim-push-server + spec: + containers: + - name: openim-push-container + image: op-push:v3.9 + env: + - name: CONFIG_PATH + value: "/config" + - name: DEPLOYMENT_TYPE + value: "kubernetes" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10170 + - containerPort: 12170 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-push-service.yml b/deployments/deploy/openim-push-service.yml new file mode 100644 index 0000000000..237f755f04 --- /dev/null +++ b/deployments/deploy/openim-push-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: openim-push-service +spec: + selector: + app: openim-push-server + ports: + - name: http-10170 + protocol: TCP + port: 10170 + targetPort: 10170 + - name: prometheus-12170 + protocol: TCP + port: 12170 + targetPort: 12170 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml new file mode 100644 index 0000000000..baccaf5442 --- /dev/null +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: auth-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: auth-rpc-server + template: + metadata: + labels: + app: auth-rpc-server + spec: + containers: + - name: auth-rpc-server-container + image: op-auth:v3.9 + imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + ports: + - containerPort: 10200 + - containerPort: 12200 + volumes: + - name: openim-config + configMap: + name: openim-config diff --git a/deployments/deploy/openim-rpc-auth-service.yml b/deployments/deploy/openim-rpc-auth-service.yml new file mode 100644 index 0000000000..7d798383fb --- /dev/null +++ b/deployments/deploy/openim-rpc-auth-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: auth-rpc-service +spec: + selector: + app: auth-rpc-server + ports: + - name: http-10200 + protocol: TCP + port: 10200 + targetPort: 10200 + - name: prometheus-12200 + protocol: TCP + port: 12200 + targetPort: 12200 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml new file mode 100644 index 0000000000..44713ff44a --- /dev/null +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: conversation-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: conversation-rpc-server + template: + metadata: + labels: + app: conversation-rpc-server + spec: + containers: + - name: conversation-rpc-server-container + image: op-conversation:v3.9 + imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10220 + - containerPort: 12220 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-conversation-service.yml b/deployments/deploy/openim-rpc-conversation-service.yml new file mode 100644 index 0000000000..f9be231ad5 --- /dev/null +++ b/deployments/deploy/openim-rpc-conversation-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: conversation-rpc-service +spec: + selector: + app: conversation-rpc-server + ports: + - name: http-10220 + protocol: TCP + port: 10220 + targetPort: 10220 + - name: prometheus-12220 + protocol: TCP + port: 12220 + targetPort: 12220 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml new file mode 100644 index 0000000000..cf38d86c11 --- /dev/null +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: friend-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: friend-rpc-server + template: + metadata: + labels: + app: friend-rpc-server + spec: + containers: + - name: friend-rpc-server-container + image: op-friend:v3.9 + # imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10240 + - containerPort: 12240 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-friend-service.yml b/deployments/deploy/openim-rpc-friend-service.yml new file mode 100644 index 0000000000..b6b512baab --- /dev/null +++ b/deployments/deploy/openim-rpc-friend-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: friend-rpc-service +spec: + selector: + app: friend-rpc-server + ports: + - name: http-10240 + protocol: TCP + port: 10240 + targetPort: 10240 + - name: prometheus-12240 + protocol: TCP + port: 12240 + targetPort: 12240 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml new file mode 100644 index 0000000000..bf433413a4 --- /dev/null +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: group-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: group-rpc-server + template: + metadata: + labels: + app: group-rpc-server + spec: + containers: + - name: group-rpc-server-container + image: op-group:v3.9 + # imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10260 + - containerPort: 12260 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-group-service.yml b/deployments/deploy/openim-rpc-group-service.yml new file mode 100644 index 0000000000..bccc0803fb --- /dev/null +++ b/deployments/deploy/openim-rpc-group-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: group-rpc-service +spec: + selector: + app: group-rpc-server + ports: + - name: http-10260 + protocol: TCP + port: 10260 + targetPort: 10260 + - name: prometheus-12260 + protocol: TCP + port: 12260 + targetPort: 12260 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml new file mode 100644 index 0000000000..dee3cb3d15 --- /dev/null +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: msg-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: msg-rpc-server + template: + metadata: + labels: + app: msg-rpc-server + spec: + containers: + - name: msg-rpc-server-container + image: op-msg:v3.9 + # imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10280 + - containerPort: 12280 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-msg-service.yml b/deployments/deploy/openim-rpc-msg-service.yml new file mode 100644 index 0000000000..db7610e8b5 --- /dev/null +++ b/deployments/deploy/openim-rpc-msg-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: msg-rpc-service +spec: + selector: + app: msg-rpc-server + ports: + - name: http-10280 + protocol: TCP + port: 10280 + targetPort: 10280 + - name: prometheus-12280 + protocol: TCP + port: 12280 + targetPort: 12280 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml new file mode 100644 index 0000000000..052b47c6be --- /dev/null +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: third-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: third-rpc-server + template: + metadata: + labels: + app: third-rpc-server + spec: + containers: + - name: third-rpc-server-container + image: op-third:v3.9 + # imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: minio-secret + key: minio-root-user + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: minio-secret + key: minio-root-password + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10300 + - containerPort: 12300 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-third-service.yml b/deployments/deploy/openim-rpc-third-service.yml new file mode 100644 index 0000000000..8cd34c2851 --- /dev/null +++ b/deployments/deploy/openim-rpc-third-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: third-rpc-service +spec: + selector: + app: third-rpc-server + ports: + - name: http-10300 + protocol: TCP + port: 10300 + targetPort: 10300 + - name: prometheus-12300 + protocol: TCP + port: 12300 + targetPort: 12300 + type: ClusterIP diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml new file mode 100644 index 0000000000..cea41ee853 --- /dev/null +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: user-rpc-server +spec: + replicas: 1 + selector: + matchLabels: + app: user-rpc-server + template: + metadata: + labels: + app: user-rpc-server + spec: + containers: + - name: user-rpc-server-container + image: op-user:v3.9 + # imagePullPolicy: Never + env: + - name: DEPLOYMENT_TYPE + value: "kubernetes" + - name: CONFIG_PATH + value: "/config" + volumeMounts: + - name: openim-config + mountPath: "/config" + readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true + ports: + - containerPort: 10320 + - containerPort: 12320 + volumes: + - name: openim-config + configMap: + name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-rpc-user-service.yml b/deployments/deploy/openim-rpc-user-service.yml new file mode 100644 index 0000000000..50cef3c88d --- /dev/null +++ b/deployments/deploy/openim-rpc-user-service.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: user-rpc-service +spec: + selector: + app: user-rpc-server + ports: + - name: http-10320 + protocol: TCP + port: 10320 + targetPort: 10320 + - name: prometheus-12320 + protocol: TCP + port: 12320 + targetPort: 12320 + type: ClusterIP diff --git a/deployments/deploy/prometheus-config.yml b/deployments/deploy/prometheus-config.yml new file mode 100644 index 0000000000..0fc51b1fd5 --- /dev/null +++ b/deployments/deploy/prometheus-config.yml @@ -0,0 +1,112 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: prometheus-config +data: + prometheus.yml: | + # my global config + global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Alertmanager configuration + alerting: + alertmanagers: + - static_configs: + - targets: [internal_ip:19093] + + # Load rules once and periodically evaluate them according to the global evaluation_interval. + rule_files: + - instance-down-rules.yml + # - first_rules.yml + # - second_rules.yml + + # A scrape configuration containing exactly one endpoint to scrape: + # Here it's Prometheus itself. + scrape_configs: + # The job name is added as a label "job=job_name" to any timeseries scraped from this config. + # Monitored information captured by prometheus + + # prometheus fetches application services + - job_name: node_exporter + static_configs: + - targets: [internal_ip:20500] + - job_name: openimserver-openim-api + static_configs: + - targets: [internal_ip:12002] + labels: + namespace: default + - job_name: openimserver-openim-msggateway + static_configs: + - targets: [internal_ip:12140] + # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] + labels: + namespace: default + - job_name: openimserver-openim-msgtransfer + static_configs: + - targets: + [ + internal_ip:12020, + internal_ip:12021, + internal_ip:12022, + internal_ip:12023, + internal_ip:12024, + internal_ip:12025, + internal_ip:12026, + internal_ip:12027, + ] + # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] + labels: + namespace: default + - job_name: openimserver-openim-push + static_configs: + - targets: + [ + internal_ip:12170, + internal_ip:12171, + internal_ip:12172, + internal_ip:12173, + internal_ip:12174, + internal_ip:12175, + internal_ip:12176, + internal_ip:12177, + ] + # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-auth + static_configs: + - targets: [internal_ip:12200] + labels: + namespace: default + - job_name: openimserver-openim-rpc-conversation + static_configs: + - targets: [internal_ip:12220] + labels: + namespace: default + - job_name: openimserver-openim-rpc-friend + static_configs: + - targets: [internal_ip:12240] + labels: + namespace: default + - job_name: openimserver-openim-rpc-group + static_configs: + - targets: [internal_ip:12260] + labels: + namespace: default + - job_name: openimserver-openim-rpc-msg + static_configs: + - targets: [internal_ip:12280] + labels: + namespace: default + - job_name: openimserver-openim-rpc-third + static_configs: + - targets: [internal_ip:12300] + labels: + namespace: default + - job_name: openimserver-openim-rpc-user + static_configs: + - targets: [internal_ip:12320] + labels: + namespace: default diff --git a/deployments/deploy/redis-service.yml b/deployments/deploy/redis-service.yml new file mode 100644 index 0000000000..d076fd119d --- /dev/null +++ b/deployments/deploy/redis-service.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-service + labels: + app: redis +spec: + type: ClusterIP + selector: + app: redis + ports: + - name: redis-port + protocol: TCP + port: 16379 + targetPort: 6379 diff --git a/deployments/deploy/redis-statefulset.yml b/deployments/deploy/redis-statefulset.yml new file mode 100644 index 0000000000..a2f9d8cfcf --- /dev/null +++ b/deployments/deploy/redis-statefulset.yml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: redis-statefulset +spec: + serviceName: "redis" + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + labels: + app: redis + spec: + containers: + - name: redis + image: redis:7.0.0 + ports: + - containerPort: 6379 + env: + - name: TZ + value: "Asia/Shanghai" + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + volumeMounts: + - name: redis-data + mountPath: /data + # - name: redis-config-volume + # mountPath: /usr/local/redis/config/redis.conf + # subPath: redis.conf + command: + [ + "/bin/sh", + "-c", + 'redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes', + ] + volumes: + - name: redis-config-volume + configMap: + name: openim-config + - name: redis-data + persistentVolumeClaim: + claimName: redis-pvc +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi +--- +apiVersion: v1 +kind: Secret +metadata: + name: redis-secret +type: Opaque +data: + redis-password: b3BlbklNMTIz # "openIM123" in base64 From ce27a4acdfb19213389b868353d7bcd93457ccc5 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 12:28:54 +0800 Subject: [PATCH 05/33] update check logic. --- tools/check-component/main.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/check-component/main.go b/tools/check-component/main.go index 9ca623a4fe..384d8c1b9f 100644 --- a/tools/check-component/main.go +++ b/tools/check-component/main.go @@ -18,7 +18,7 @@ import ( "context" "flag" "fmt" - "io/ioutil" + "io" "log" "os" "path/filepath" @@ -37,10 +37,16 @@ import ( const maxRetry = 180 +const ( + MountConfigFilePath = "CONFIG_PATH" + DeploymentType = "DEPLOYMENT_TYPE" + KUBERNETES = "kubernetes" +) + func CheckZookeeper(ctx context.Context, config *config.ZooKeeper) error { // Temporary disable logging originalLogger := log.Default().Writer() - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) defer log.SetOutput(originalLogger) // Ensure logging is restored return zookeeper.Check(ctx, config.Address, config.Schema, zookeeper.WithUserNameAndPassword(config.Username, config.Password)) } @@ -78,6 +84,13 @@ func initConfig(configDir string) (*config.Mongo, *config.Redis, *config.Kafka, discovery = &config.Discovery{} thirdConfig = &config.Third{} ) + if os.Getenv(DeploymentType) == KUBERNETES { + configDir = os.Getenv(MountConfigFilePath) + if configDir == "" { + return nil, nil, nil, nil, nil, fmt.Errorf("%s env is empty", MountConfigFilePath) + } + } + err := config.Load(configDir, cmd.MongodbConfigFileName, cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig) if err != nil { return nil, nil, nil, nil, nil, err From 300778f3ed90a6588cf030a8044b89fe83c87e31 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 14:09:14 +0800 Subject: [PATCH 06/33] update magefile --- magefile.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/magefile.go b/magefile.go index efa27bd583..d2c61b9a38 100644 --- a/magefile.go +++ b/magefile.go @@ -4,6 +4,7 @@ package main import ( + "flag" "os" "github.com/mo3et/openim-gomake/mageutil" @@ -12,7 +13,14 @@ import ( var Default = Build func Build() { - mageutil.Build() + flag.Parse() + + bin := flag.Args() + if len(bin) != 0 { + bin = bin[1:] + } + + mageutil.Build(bin) } func Start() { From 6143a5cf55fcb08b1d612afcc0e3a4f7c4adfc0a Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 14:42:30 +0800 Subject: [PATCH 07/33] update image name. --- deployments/deploy/openim-api-deployment.yml | 2 +- deployments/deploy/openim-crontask-deployment.yml | 2 +- deployments/deploy/openim-msggateway-deployment.yml | 2 +- deployments/deploy/openim-msgtransfer-deployment.yml | 2 +- deployments/deploy/openim-push-deployment.yml | 2 +- deployments/deploy/openim-rpc-auth-deployment.yml | 2 +- deployments/deploy/openim-rpc-conversation-deployment.yml | 2 +- deployments/deploy/openim-rpc-friend-deployment.yml | 2 +- deployments/deploy/openim-rpc-group-deployment.yml | 2 +- deployments/deploy/openim-rpc-msg-deployment.yml | 2 +- deployments/deploy/openim-rpc-third-deployment.yml | 2 +- deployments/deploy/openim-rpc-user-deployment.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index 981717156f..3e0ef8a056 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-api-container - image: op-api:v3.90 + image: openim-api:v3.9 # imagePullPolicy: Never env: - name: CONFIG_PATH diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml index 969837de45..ef4b64fd94 100644 --- a/deployments/deploy/openim-crontask-deployment.yml +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: crontask-container - image: op-crontask:v3.9 + image: openim-crontask:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index 1c0a1d43c0..6361b4cf63 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-msggateway-container - image: op-msggateway:v3.9 + image: openim-msggateway:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml index ccc0f64712..817ae92f91 100644 --- a/deployments/deploy/openim-msgtransfer-deployment.yml +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-msgtransfer-container - image: op-msgtransfer:v3.9 + image: openim-msgtransfer:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index 06c44b60cd..1602c06880 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-push-container - image: op-push:v3.9 + image: openim-push:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml index baccaf5442..a23e7c6d73 100644 --- a/deployments/deploy/openim-rpc-auth-deployment.yml +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: auth-rpc-server-container - image: op-auth:v3.9 + image: openim-auth:v3.9 imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index 44713ff44a..713c3fdcdc 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: conversation-rpc-server-container - image: op-conversation:v3.9 + image: openim-conversation:v3.9 imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index cf38d86c11..f0a12c5627 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: friend-rpc-server-container - image: op-friend:v3.9 + image: openim-friend:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index bf433413a4..b86d85ddb5 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: group-rpc-server-container - image: op-group:v3.9 + image: openim-group:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index dee3cb3d15..4443742515 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: msg-rpc-server-container - image: op-msg:v3.9 + image: openim-msg:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index 052b47c6be..f65255f40e 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: third-rpc-server-container - image: op-third:v3.9 + image: openim-third:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index cea41ee853..c12b535b08 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: user-rpc-server-container - image: op-user:v3.9 + image: openim-user:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE From 34236ad6b5e2362fbfeace89c8747dfba67361d5 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 14:42:45 +0800 Subject: [PATCH 08/33] update readme --- deployments/deploy/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deployments/deploy/README.md b/deployments/deploy/README.md index 874a339765..577c183a18 100644 --- a/deployments/deploy/README.md +++ b/deployments/deploy/README.md @@ -1,9 +1,11 @@ # Kubernetes Deployment -## Origin Deploy - -## First, Deployment All config and services +## Resource Requests +- CPU: 2 cores +- Memory: 4 GiB +- Disk usage: 20 GiB (on Node) +## Origin Deploy 1. Enter the target dir `cd ./deployments/deploy/` @@ -19,7 +21,7 @@ Run infrasturcture components. >Note: Ensure that infrastructure services like MinIO, Redis, and Kafka are running before deploying the main applications. -Final, run all deployments and services +3. run all deployments and services ```bash kubectl apply \ From ac20cc969f69e667915ebfa44e6042f09480273e Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 18:15:08 +0800 Subject: [PATCH 09/33] update Kubernetes Discovery. --- pkg/common/discoveryregister/discoveryregister.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 1911c0abfd..c18fefb053 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -38,7 +38,7 @@ func NewDiscoveryRegister(discovery *config.Discovery, share *config.Share) (dis zookeeper.WithTimeout(10), ) case "kubernetes": - return kubernetes.NewK8sConnManager("default") + return kubernetes.NewKubernetesConnManager("default") case "etcd": return etcd.NewSvcDiscoveryRegistry( discovery.Etcd.RootDirectory, From 36ac5e0b4dd3e751eccd3092bf2b00aa106ad4ea Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 13 Nov 2024 18:17:18 +0800 Subject: [PATCH 10/33] revert pkg. --- magefile.go | 2 +- magefile_unix.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/magefile.go b/magefile.go index d2c61b9a38..d0e77f6fc0 100644 --- a/magefile.go +++ b/magefile.go @@ -7,7 +7,7 @@ import ( "flag" "os" - "github.com/mo3et/openim-gomake/mageutil" + "github.com/openimsdk/gomake/mageutil" ) var Default = Build diff --git a/magefile_unix.go b/magefile_unix.go index 1acf8fdd6c..4bb0cc1a95 100644 --- a/magefile_unix.go +++ b/magefile_unix.go @@ -6,7 +6,7 @@ package main import ( "syscall" - "github.com/mo3et/openim-gomake/mageutil" + "github.com/openimsdk/gomake/mageutil" ) func setMaxOpenFiles() error { From f3f0fd022e0c8b8704411a07632949be52efcdb0 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 21 Nov 2024 13:21:55 +0800 Subject: [PATCH 11/33] update create in k8s --- deployments/deploy/kafka-statefulset.yml | 36 +------- deployments/deploy/mongo-statefulset.yml | 37 +++++--- deployments/deploy/openim-config.yml | 106 ----------------------- 3 files changed, 29 insertions(+), 150 deletions(-) diff --git a/deployments/deploy/kafka-statefulset.yml b/deployments/deploy/kafka-statefulset.yml index 27821bb690..5672e6680a 100644 --- a/deployments/deploy/kafka-statefulset.yml +++ b/deployments/deploy/kafka-statefulset.yml @@ -30,18 +30,6 @@ spec: - containerPort: 9092 # PLAINTEXT - containerPort: 9093 # CONTROLLER - containerPort: 9094 # EXTERNAL - # command: - # - /bin/bash - # - "-c" - # - | - # # /opt/bitnami/scripts/kafka/run.sh & /opt/bitnami/kafka/create-topic.sh; wait - # # /opt/bitnami/scripts/kafka/entrypoint.sh && /opt/bitnami/scripts/kafka/setup.sh && /opt/bitnami/scripts/kafka/run.sh - # & while ! echo > /dev/tcp/localhost/9092; do - # echo "Waiting for Kafka to start..." - # sleep 5 - # done - # /opt/bitnami/kafka/create-topic.sh - # tail -f /dev/null env: - name: TZ value: "Asia/Shanghai" @@ -59,34 +47,18 @@ spec: value: "CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT" - name: KAFKA_CFG_CONTROLLER_LISTENER_NAMES value: "CONTROLLER" + - name: KAFKA_NUM_PARTITIONS + value: "8" + - name: KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE + value: "true" volumeMounts: - name: kafka-data mountPath: /bitnami/kafka - - name: kafka-scripts - mountPath: /opt/bitnami/kafka/create-topic.sh - subPath: create-topic.sh - - name: create-topics - image: bitnami/kafka:3.5.1 - command: - - /bin/bash - - "-c" - - | - /opt/bitnami/kafka/create-topic.sh && \ - tail -f /dev/null - volumeMounts: - - name: kafka-scripts - mountPath: /opt/bitnami/kafka/create-topic.sh - subPath: create-topic.sh - - name: kafka-data - mountPath: /bitnami/kafka volumes: - name: kafka-scripts configMap: name: openim-config defaultMode: 0755 - items: - - key: create-topic.sh - path: create-topic.sh - name: kafka-data persistentVolumeClaim: claimName: kafka-pvc diff --git a/deployments/deploy/mongo-statefulset.yml b/deployments/deploy/mongo-statefulset.yml index 2359cbce98..77702fb46e 100644 --- a/deployments/deploy/mongo-statefulset.yml +++ b/deployments/deploy/mongo-statefulset.yml @@ -15,12 +15,35 @@ spec: spec: containers: - name: mongo - image: mongo:6.0.2 + image: mongo:7.0 command: [ "/bin/bash", "-c", - "docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth & sleep 15; /scripts/mongo-init.sh; wait", + ' + docker-entrypoint.sh mongod --wiredTigerCacheSizeGB $wiredTigerCacheSizeGB --auth & + until mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin --eval "db.runCommand({ ping: 1 })" &>/dev/null; do + echo "Waiting for MongoDB to start..." + sleep 1 + done && + mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin --eval " + db = db.getSiblingDB(\"$MONGO_INITDB_DATABASE\"); + if (!db.getUser(\"$MONGO_OPENIM_USERNAME\")) { + db.createUser({ + user: \"$MONGO_OPENIM_USERNAME\", + pwd: \"$MONGO_OPENIM_PASSWORD\", + roles: [{role: \"readWrite\", db: \"$MONGO_INITDB_DATABASE\"}] + }); + print(\"User created successfully: \"); + print(\"Username: $MONGO_OPENIM_USERNAME\"); + print(\"Password: $MONGO_OPENIM_PASSWORD\"); + print(\"Database: $MONGO_INITDB_DATABASE\"); + } else { + print(\"User already exists in database: $MONGO_INITDB_DATABASE, Username: $MONGO_OPENIM_USERNAME\"); + } + " && + tail -f /dev/null + ' ] ports: - containerPort: 27017 @@ -53,18 +76,8 @@ spec: volumeMounts: - name: mongo-storage mountPath: /data/db - - name: script-volume - mountPath: /scripts - # subPath: mongo-init.sh volumes: - - name: script-volume - configMap: - name: openim-config - items: - - key: mongo-init.sh - path: mongo-init.sh - mode: 0755 - name: mongo-storage persistentVolumeClaim: claimName: mongo-pvc diff --git a/deployments/deploy/openim-config.yml b/deployments/deploy/openim-config.yml index 30d683c127..cf87cfa072 100644 --- a/deployments/deploy/openim-config.yml +++ b/deployments/deploy/openim-config.yml @@ -811,112 +811,6 @@ data: labels: namespace: default - mongo-init.sh: | - echo "before running mongosh..." - mongosh < 0) { - try { - print('Attempting to connect to MongoDB. Remaining retries: ' + maxRetries); - db = connect('mongodb://127.0.0.1:27017/admin'); - var authResult = db.auth(rootUsername, rootPassword); - if (authResult) { - print('Authentication successful for root user: ' + rootUsername); - connected = true; - } else { - print('Authentication failed for root user: ' + rootUsername + ' with password: ' + rootPassword); - quit(1); - } - } catch (e) { - maxRetries--; - print('Connection failed due to error: ' + e); - print('Retrying... Remaining attempts: ' + maxRetries); - sleep(1000); // Sleep for 1 second - } - } - - if (connected) { - print('Connected to MongoDB successfully. Proceeding to create user...'); - db = db.getSiblingDB(dbName); - var createUserResult = db.createUser({ - user: openimUsername, - pwd: openimPassword, - roles: [{ - role: 'readWrite', - db: dbName - }] - }); - - if (createUserResult.ok == 1) { - print('User creation successful. User: ' + openimUsername + ', Database: ' + dbName); - } else { - print('User creation failed for user: ' + openimUsername + ' in database: ' + dbName); - quit(1); - } - } else { - print('Failed to connect to MongoDB after 300 retries.'); - quit(1); - } - - print('Script execution completed.'); - EOF - echo "mongosh completed..." - - create-topic.sh: | - #!/usr/bin/env bash - # Wait for Kafka to be ready - - KAFKA_SERVER=kafka-service:9092 - - MAX_ATTEMPTS=300 - attempt_num=1 - - echo "Waiting for Kafka to be ready..." - - until /opt/bitnami/kafka/bin/kafka-topics.sh --list --bootstrap-server $KAFKA_SERVER; do - echo "Attempt $attempt_num of $MAX_ATTEMPTS: Kafka not ready yet..." - if [ $attempt_num -eq $MAX_ATTEMPTS ]; then - echo "Kafka not ready after $MAX_ATTEMPTS attempts, exiting" - exit 1 - fi - attempt_num=$((attempt_num+1)) - sleep 1 - done - - echo "Kafka is ready. Creating topics..." - - - topics=("toRedis" "toMongo" "toPush" "toOfflinePush") - partitions=8 - replicationFactor=1 - - for topic in "${topics[@]}"; do - if /opt/bitnami/kafka/bin/kafka-topics.sh --create \ - --bootstrap-server $KAFKA_SERVER \ - --replication-factor $replicationFactor \ - --partitions $partitions \ - --topic $topic - then - echo "Topic $topic created." - else - echo "Failed to create topic $topic." - fi - done - - echo "All topics created." - webhooks.yml: | url: http://127.0.0.1:10006/callbackExample beforeSendSingleMsg: From 99865d71109c19c31f08c021e0822e3b62654c1a Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 10:12:36 +0800 Subject: [PATCH 12/33] update service image release CI. --- .../workflows/docker-build-and-release.yml | 91 +++++++++++++++++++ build/images/openim-cmdutils/Dockerfile | 44 --------- 2 files changed, 91 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/docker-build-and-release.yml delete mode 100644 build/images/openim-cmdutils/Dockerfile diff --git a/.github/workflows/docker-build-and-release.yml b/.github/workflows/docker-build-and-release.yml new file mode 100644 index 0000000000..76602c4d1c --- /dev/null +++ b/.github/workflows/docker-build-and-release.yml @@ -0,0 +1,91 @@ +name: Build and release services Docker Images + +on: + push: + branches: + - release-* + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: "Tag version to be used for Docker image" + required: true + default: "v3.8.3" + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Log in to Aliyun Container Registry + uses: docker/login-action@v2 + with: + registry: registry.cn-hangzhou.aliyuncs.com + username: ${{ secrets.ALIREGISTRY_USERNAME }} + password: ${{ secrets.ALIREGISTRY_TOKEN }} + + - name: Extract metadata for Docker (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + tags: | + type=ref,event=tag + type=schedule + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern=v{{version}} + # type=semver,pattern={{major}}.{{minor}} + type=semver,pattern=release-{{raw}} + type=sha + type=raw,value=${{ github.event.inputs.tag }} + + - name: Build and push Docker images + run: | + ROOT_DIR="build/images" + for dir in "$ROOT_DIR"/*/; do + # Find Dockerfile or *.dockerfile in a case-insensitive manner + dockerfile=$(find "$dir" -maxdepth 1 -type f \( -iname 'dockerfile' -o -iname '*.dockerfile' \) | head -n 1) + + if [ -n "$dockerfile" ] && [ -f "$dockerfile" ]; then + IMAGE_NAME=$(basename "$dir") + echo "Building Docker image for $IMAGE_NAME with tags:" + + # Initialize tag arguments + tag_args=() + + # Read each tag and append --tag arguments + while IFS= read -r tag; do + tag_args+=(--tag "${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$tag") + tag_args+=(--tag "ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$tag") + tag_args+=(--tag "registry.cn-hangzhou.aliyuncs.com/openimsdk/$IMAGE_NAME:$tag") + done <<< "${{ steps.meta.outputs.tags }}" + + # Build and push the Docker image with all tags + docker buildx build --platform linux/amd64,linux/arm64 \ + --file "$dockerfile" \ + "${tag_args[@]}" \ + --push "$dir" + else + echo "No valid Dockerfile found in $dir" + fi + done \ No newline at end of file diff --git a/build/images/openim-cmdutils/Dockerfile b/build/images/openim-cmdutils/Dockerfile deleted file mode 100644 index e8589439a1..0000000000 --- a/build/images/openim-cmdutils/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# # Copyright © 2023 OpenIM. All rights reserved. -# # -# # Licensed under the Apache License, Version 2.0 (the "License"); -# # you may not use this file except in compliance with the License. -# # You may obtain a copy of the License at -# # -# # http://www.apache.org/licenses/LICENSE-2.0 -# # -# # Unless required by applicable law or agreed to in writing, software -# # distributed under the License is distributed on an "AS IS" BASIS, -# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# # See the License for the specific language governing permissions and -# # limitations under the License. - -# # OpenIM base image: https://github.com/openim-sigs/openim-base-image - -# # Set go mod installation source and proxy - -# FROM golang:1.20 AS builder - -# ARG GO111MODULE=on - -# WORKDIR /openim/openim-server - -# ENV GO111MODULE=$GO111MODULE -# ENV GOPROXY=$GOPROXY - -# COPY go.mod go.sum ./ -# RUN go mod download - -# COPY . . - -# RUN make build BINS=openim-cmdutils -# RUN cp /openim/openim-server/_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/openim-cmdutils /usr/bin/openim-cmdutils - -# FROM ghcr.io/openim-sigs/openim-bash-image:latest - -# WORKDIR /openim/openim-server - -# COPY --from=builder /usr/bin/openim-cmdutils ./bin/openim-cmdutils - -# ENTRYPOINT ["./bin/openim-cmdutils"] - -# CMD ["--help"] From 387554ffb2a3da94db4f005cdad1c9ef40301491 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 10:13:49 +0800 Subject: [PATCH 13/33] update deployment image source. --- deployments/deploy/openim-api-deployment.yml | 2 +- deployments/deploy/openim-crontask-deployment.yml | 2 +- deployments/deploy/openim-msggateway-deployment.yml | 2 +- deployments/deploy/openim-msgtransfer-deployment.yml | 2 +- deployments/deploy/openim-push-deployment.yml | 2 +- deployments/deploy/openim-rpc-auth-deployment.yml | 2 +- deployments/deploy/openim-rpc-conversation-deployment.yml | 2 +- deployments/deploy/openim-rpc-friend-deployment.yml | 2 +- deployments/deploy/openim-rpc-group-deployment.yml | 2 +- deployments/deploy/openim-rpc-msg-deployment.yml | 2 +- deployments/deploy/openim-rpc-third-deployment.yml | 2 +- deployments/deploy/openim-rpc-user-deployment.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index 3e0ef8a056..0ae628fb0b 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-api-container - image: openim-api:v3.9 + image: openim/openim-api:v3.9 # imagePullPolicy: Never env: - name: CONFIG_PATH diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml index ef4b64fd94..bdbff149c8 100644 --- a/deployments/deploy/openim-crontask-deployment.yml +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: crontask-container - image: openim-crontask:v3.9 + image: openim/openim-crontask:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index 6361b4cf63..a2ce2ef16d 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-msggateway-container - image: openim-msggateway:v3.9 + image: openim/openim-msggateway:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml index 817ae92f91..264b478fa3 100644 --- a/deployments/deploy/openim-msgtransfer-deployment.yml +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-msgtransfer-container - image: openim-msgtransfer:v3.9 + image: openim/openim-msgtransfer:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index 1602c06880..8c01eefc83 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: openim-push-container - image: openim-push:v3.9 + image: openim/openim-push:v3.9 env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml index a23e7c6d73..89022a085b 100644 --- a/deployments/deploy/openim-rpc-auth-deployment.yml +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: auth-rpc-server-container - image: openim-auth:v3.9 + image: openim/openim-rpc-auth:v3.9 imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index 713c3fdcdc..4c09dee831 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: conversation-rpc-server-container - image: openim-conversation:v3.9 + image: openim/openim-rpc-conversation:v3.9 imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index f0a12c5627..4829f7abdb 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: friend-rpc-server-container - image: openim-friend:v3.9 + image: openim/openim-rpc-friend:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index b86d85ddb5..b4bb9792d8 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: group-rpc-server-container - image: openim-group:v3.9 + image: openim/openim-rpc-group:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index 4443742515..ea9ff2131d 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: msg-rpc-server-container - image: openim-msg:v3.9 + image: openim/openim-rpc-msg:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index f65255f40e..e1a33c780b 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: third-rpc-server-container - image: openim-third:v3.9 + image: openim/openim-rpc-third:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index c12b535b08..102faa3bec 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: user-rpc-server-container - image: openim-user:v3.9 + image: openim/openim-rpc-user:v3.9 # imagePullPolicy: Never env: - name: DEPLOYMENT_TYPE From 08edbf2d6d5743a3b05c94337beb0fe7e62846a1 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 10:14:02 +0800 Subject: [PATCH 14/33] update mage contents. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f4eb6213bd..5df034bf15 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/kelindar/bitmap v1.5.2 github.com/likexian/gokit v0.25.13 - github.com/openimsdk/gomake v0.0.14-alpha.5 + github.com/openimsdk/gomake v0.0.15-alpha.1 github.com/redis/go-redis/v9 v9.4.0 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil v3.21.11+incompatible diff --git a/go.sum b/go.sum index 264f1e9fe9..dd818cc709 100644 --- a/go.sum +++ b/go.sum @@ -345,8 +345,8 @@ github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= -github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCFsz7t7vbv7Y= -github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= +github.com/openimsdk/gomake v0.0.15-alpha.1 h1:a3U0gayzEJJucOoIOt9Jju+HQTG2BtKcuLG4AVjeVF4= +github.com/openimsdk/gomake v0.0.15-alpha.1/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.72-alpha.57 h1:oAVg0SJkDK15L8yDrL0KPG32f3iB/vjEpfpX577p5n4= github.com/openimsdk/protocol v0.0.72-alpha.57/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M= github.com/openimsdk/tools v0.0.50-alpha.38 h1:AU6/cvDfN4ciIOwAj8IWEwze3DeEp2cHYPgW3y0OlbU= From 84c8c0e9678451476858bbd895a14ed38c4f570b Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 10:18:23 +0800 Subject: [PATCH 15/33] update pkg source. --- Dockerfile | 2 +- build/images/openim-api/Dockerfile | 2 +- build/images/openim-crontask/Dockerfile | 2 +- build/images/openim-msggateway/Dockerfile | 2 +- build/images/openim-msgtransfer/Dockerfile | 2 +- build/images/openim-push/Dockerfile | 2 +- build/images/openim-rpc-auth/Dockerfile | 2 +- build/images/openim-rpc-conversation/Dockerfile | 2 +- build/images/openim-rpc-friend/Dockerfile | 2 +- build/images/openim-rpc-group/Dockerfile | 2 +- build/images/openim-rpc-msg/Dockerfile | 2 +- build/images/openim-rpc-third/Dockerfile | 2 +- build/images/openim-rpc-user/Dockerfile | 2 +- build/images/openim-tools/component/Dockerfile | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad9b8e7c76..44ad59ad96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -RUN go get github.com/mo3et/openim-gomake@v0.0.18 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-api/Dockerfile b/build/images/openim-api/Dockerfile index cd8cb509d6..d6ce836064 100644 --- a/build/images/openim-api/Dockerfile +++ b/build/images/openim-api/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-api: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-crontask/Dockerfile b/build/images/openim-crontask/Dockerfile index 97e68a8256..68de9259bf 100644 --- a/build/images/openim-crontask/Dockerfile +++ b/build/images/openim-crontask/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-crontask: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msggateway/Dockerfile b/build/images/openim-msggateway/Dockerfile index 31c26e7d45..a4f9550734 100644 --- a/build/images/openim-msggateway/Dockerfile +++ b/build/images/openim-msggateway/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-msggateway: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msgtransfer/Dockerfile b/build/images/openim-msgtransfer/Dockerfile index 602037fa13..c968262ef0 100644 --- a/build/images/openim-msgtransfer/Dockerfile +++ b/build/images/openim-msgtransfer/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-msgtransfer: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-push/Dockerfile b/build/images/openim-push/Dockerfile index b5973b4a53..23ce8535a7 100644 --- a/build/images/openim-push/Dockerfile +++ b/build/images/openim-push/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-push: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-auth/Dockerfile b/build/images/openim-rpc-auth/Dockerfile index e6f16553eb..9b19b92dbf 100644 --- a/build/images/openim-rpc-auth/Dockerfile +++ b/build/images/openim-rpc-auth/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-auth: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-conversation/Dockerfile b/build/images/openim-rpc-conversation/Dockerfile index e90ebb9c2b..de38eca539 100644 --- a/build/images/openim-rpc-conversation/Dockerfile +++ b/build/images/openim-rpc-conversation/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-conversation: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-friend/Dockerfile b/build/images/openim-rpc-friend/Dockerfile index d481300915..cc0dd05a6d 100644 --- a/build/images/openim-rpc-friend/Dockerfile +++ b/build/images/openim-rpc-friend/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-friend: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-group/Dockerfile b/build/images/openim-rpc-group/Dockerfile index 6d627c1e68..3a8b5bce2c 100644 --- a/build/images/openim-rpc-group/Dockerfile +++ b/build/images/openim-rpc-group/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-group: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-msg/Dockerfile b/build/images/openim-rpc-msg/Dockerfile index fc372dc1e8..f87dd899ba 100644 --- a/build/images/openim-rpc-msg/Dockerfile +++ b/build/images/openim-rpc-msg/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-msg: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-third/Dockerfile b/build/images/openim-rpc-third/Dockerfile index bcfb37f83f..01950bf6e9 100644 --- a/build/images/openim-rpc-third/Dockerfile +++ b/build/images/openim-rpc-third/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-third: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-user/Dockerfile b/build/images/openim-rpc-user/Dockerfile index c02e538fc8..5d0103bf65 100644 --- a/build/images/openim-rpc-user/Dockerfile +++ b/build/images/openim-rpc-user/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-user: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-tools/component/Dockerfile b/build/images/openim-tools/component/Dockerfile index 6669f6e12b..d462f90d3f 100644 --- a/build/images/openim-tools/component/Dockerfile +++ b/build/images/openim-tools/component/Dockerfile @@ -105,7 +105,7 @@ RUN echo -e "serviceBinaries:\n \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/mo3et/openim-gomake@v0.0.74 +RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From e882519162ef2036729989606ace11d8b0632f71 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 11:59:46 +0800 Subject: [PATCH 16/33] update go get pkg. --- Dockerfile | 2 +- build/images/openim-api/Dockerfile | 2 +- build/images/openim-crontask/Dockerfile | 2 +- build/images/openim-msggateway/Dockerfile | 2 +- build/images/openim-msgtransfer/Dockerfile | 2 +- build/images/openim-push/Dockerfile | 2 +- build/images/openim-rpc-auth/Dockerfile | 2 +- build/images/openim-rpc-conversation/Dockerfile | 2 +- build/images/openim-rpc-friend/Dockerfile | 2 +- build/images/openim-rpc-group/Dockerfile | 2 +- build/images/openim-rpc-msg/Dockerfile | 2 +- build/images/openim-rpc-third/Dockerfile | 2 +- build/images/openim-rpc-user/Dockerfile | 2 +- build/images/openim-tools/component/Dockerfile | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 44ad59ad96..8a95b6851f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ COPY --from=builder $SERVER_DIR/start-config.yml $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.mod $SERVER_DIR/ COPY --from=builder $SERVER_DIR/go.sum $SERVER_DIR/ -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-api/Dockerfile b/build/images/openim-api/Dockerfile index d6ce836064..0c072f1d39 100644 --- a/build/images/openim-api/Dockerfile +++ b/build/images/openim-api/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-api: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-crontask/Dockerfile b/build/images/openim-crontask/Dockerfile index 68de9259bf..1f69854372 100644 --- a/build/images/openim-crontask/Dockerfile +++ b/build/images/openim-crontask/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-crontask: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msggateway/Dockerfile b/build/images/openim-msggateway/Dockerfile index a4f9550734..bffd1b54db 100644 --- a/build/images/openim-msggateway/Dockerfile +++ b/build/images/openim-msggateway/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-msggateway: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-msgtransfer/Dockerfile b/build/images/openim-msgtransfer/Dockerfile index c968262ef0..484cab70f4 100644 --- a/build/images/openim-msgtransfer/Dockerfile +++ b/build/images/openim-msgtransfer/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-msgtransfer: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-push/Dockerfile b/build/images/openim-push/Dockerfile index 23ce8535a7..29b7f9a37f 100644 --- a/build/images/openim-push/Dockerfile +++ b/build/images/openim-push/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-push: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-auth/Dockerfile b/build/images/openim-rpc-auth/Dockerfile index 9b19b92dbf..815ec69b26 100644 --- a/build/images/openim-rpc-auth/Dockerfile +++ b/build/images/openim-rpc-auth/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-auth: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-conversation/Dockerfile b/build/images/openim-rpc-conversation/Dockerfile index de38eca539..8a4035151a 100644 --- a/build/images/openim-rpc-conversation/Dockerfile +++ b/build/images/openim-rpc-conversation/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-conversation: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-friend/Dockerfile b/build/images/openim-rpc-friend/Dockerfile index cc0dd05a6d..0e469a0690 100644 --- a/build/images/openim-rpc-friend/Dockerfile +++ b/build/images/openim-rpc-friend/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-friend: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-group/Dockerfile b/build/images/openim-rpc-group/Dockerfile index 3a8b5bce2c..7049fa8cd5 100644 --- a/build/images/openim-rpc-group/Dockerfile +++ b/build/images/openim-rpc-group/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-group: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-msg/Dockerfile b/build/images/openim-rpc-msg/Dockerfile index f87dd899ba..6d6719840d 100644 --- a/build/images/openim-rpc-msg/Dockerfile +++ b/build/images/openim-rpc-msg/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-msg: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-third/Dockerfile b/build/images/openim-rpc-third/Dockerfile index 01950bf6e9..641be91ca0 100644 --- a/build/images/openim-rpc-third/Dockerfile +++ b/build/images/openim-rpc-third/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-third: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-rpc-user/Dockerfile b/build/images/openim-rpc-user/Dockerfile index 5d0103bf65..a7e8f31f9f 100644 --- a/build/images/openim-rpc-user/Dockerfile +++ b/build/images/openim-rpc-user/Dockerfile @@ -54,7 +54,7 @@ RUN echo -e "serviceBinaries:\n openim-rpc-user: 1 \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] diff --git a/build/images/openim-tools/component/Dockerfile b/build/images/openim-tools/component/Dockerfile index d462f90d3f..afe0ee9edf 100644 --- a/build/images/openim-tools/component/Dockerfile +++ b/build/images/openim-tools/component/Dockerfile @@ -105,7 +105,7 @@ RUN echo -e "serviceBinaries:\n \n" \ echo -e "toolBinaries:\n - check-free-memory\n - seq\n" >> $SERVER_DIR/start-config.yml && \ echo "maxFileDescriptors: 10000" >> $SERVER_DIR/start-config.yml -RUN go get github.com/openimsdk/openim-gomake@0.0.15-alpha.1 +RUN go get github.com/openimsdk/gomake@v0.0.15-alpha.1 # Set the command to run when the container starts ENTRYPOINT ["sh", "-c", "mage start && tail -f /dev/null"] From 1995cefdd8799bb1dcf276fa00e0e471b81551e5 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 4 Dec 2024 12:25:54 +0800 Subject: [PATCH 17/33] fix test file. --- pkg/common/config/load_config_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go index a0345fc7a5..52238e7064 100644 --- a/pkg/common/config/load_config_test.go +++ b/pkg/common/config/load_config_test.go @@ -1,27 +1,28 @@ package config import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestLoadLogConfig(t *testing.T) { var log Log - err := LoadConfig("../../../config/log.yml", "IMENV_LOG", &log) + err := Load("../../../config/log.yml", "IMENV_LOG", "", &log) assert.Nil(t, err) assert.Equal(t, "../../../../logs/", log.StorageLocation) } func TestLoadMinioConfig(t *testing.T) { var storageConfig Minio - err := LoadConfig("../../../config/minio.yml", "IMENV_MINIO", &storageConfig) + err := Load("../../../config/minio.yml", "IMENV_MINIO", "", &storageConfig) assert.Nil(t, err) assert.Equal(t, "openim", storageConfig.Bucket) } func TestLoadWebhooksConfig(t *testing.T) { var webhooks Webhooks - err := LoadConfig("../../../config/webhooks.yml", "IMENV_WEBHOOKS", &webhooks) + err := Load("../../../config/webhooks.yml", "IMENV_WEBHOOKS", "", &webhooks) assert.Nil(t, err) assert.Equal(t, 5, webhooks.BeforeAddBlack.Timeout) @@ -29,7 +30,7 @@ func TestLoadWebhooksConfig(t *testing.T) { func TestLoadOpenIMRpcUserConfig(t *testing.T) { var user User - err := LoadConfig("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", &user) + err := Load("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", "", &user) assert.Nil(t, err) //export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0" assert.Equal(t, "0.0.0.0", user.RPC.ListenIP) @@ -39,14 +40,14 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) { func TestLoadNotificationConfig(t *testing.T) { var noti Notification - err := LoadConfig("../../../config/notification.yml", "IMENV_NOTIFICATION", ¬i) + err := Load("../../../config/notification.yml", "IMENV_NOTIFICATION", "", ¬i) assert.Nil(t, err) assert.Equal(t, "Your friend's profile has been changed", noti.FriendRemarkSet.OfflinePush.Title) } func TestLoadOpenIMThirdConfig(t *testing.T) { var third Third - err := LoadConfig("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", &third) + err := Load("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", "", &third) assert.Nil(t, err) assert.Equal(t, "enabled", third.Object.Enable) assert.Equal(t, "https://oss-cn-chengdu.aliyuncs.com", third.Object.Oss.Endpoint) From 03cf860204ece3e72f45724035431425657ccdf7 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 7 Dec 2024 17:46:55 +0800 Subject: [PATCH 18/33] update discovery register. --- pkg/common/discoveryregister/discoveryregister.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 07ec7abfbd..419293a919 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -23,7 +23,6 @@ import ( "github.com/openimsdk/tools/discovery/kubernetes" "github.com/openimsdk/tools/discovery/etcd" - "github.com/openimsdk/tools/discovery/zookeeper" "github.com/openimsdk/tools/errs" ) @@ -34,17 +33,8 @@ func NewDiscoveryRegister(discovery *config.Discovery, runtimeEnv string) (disco } switch discovery.Enable { - case "zookeeper": - return zookeeper.NewZkClient( - discovery.ZooKeeper.Address, - discovery.ZooKeeper.Schema, - zookeeper.WithFreq(time.Hour), - zookeeper.WithUserNameAndPassword(discovery.ZooKeeper.Username, discovery.ZooKeeper.Password), - zookeeper.WithRoundRobin(), - zookeeper.WithTimeout(10), - ) - case "k8s": - return kubernetes.NewK8sDiscoveryRegister(share.RpcRegisterName.MessageGateway) + case "kubernetes": + return kubernetes.NewKubernetesConnManager(discovery.Kubernetes.Namespace) case "etcd": return etcd.NewSvcDiscoveryRegistry( discovery.Etcd.RootDirectory, From dbe44b64dc72800365e2f762b97c7e5aaf45d73d Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 7 Dec 2024 17:52:12 +0800 Subject: [PATCH 19/33] update --- start-config.yml | 2 +- tools/seq/internal/seq.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/start-config.yml b/start-config.yml index 3ffd540ae1..1231b5d0d4 100644 --- a/start-config.yml +++ b/start-config.yml @@ -13,6 +13,6 @@ serviceBinaries: openim-rpc-third: 1 toolBinaries: - check-free-memory - # - check-component + - check-component - seq maxFileDescriptors: 10000 diff --git a/tools/seq/internal/seq.go b/tools/seq/internal/seq.go index cb6387a9cf..62466670ec 100644 --- a/tools/seq/internal/seq.go +++ b/tools/seq/internal/seq.go @@ -20,6 +20,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/utils/runtimeenv" "github.com/redis/go-redis/v9" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -42,9 +43,10 @@ const ( ) func readConfig[T any](dir string, name string) (*T, error) { - if os.Getenv(config.DeploymentType) == config.KUBERNETES { + if runtimeenv.PrintRuntimeEnvironment() == config.KUBERNETES { dir = os.Getenv(config.MountConfigFilePath) } + data, err := os.ReadFile(filepath.Join(dir, name)) if err != nil { return nil, err From 8acd160af5fdb4a7db636caf638350d9313b4e51 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 7 Dec 2024 18:10:58 +0800 Subject: [PATCH 20/33] update deploy yaml. --- deployments/deploy/clusterRole.yml | 25 +++++++++++ deployments/deploy/kafka-statefulset.yml | 7 +--- deployments/deploy/mongo-statefulset.yml | 42 +++++++++---------- deployments/deploy/openim-api-deployment.yml | 6 +-- .../deploy/openim-crontask-deployment.yml | 5 +-- .../deploy/openim-msggateway-deployment.yml | 4 +- .../deploy/openim-msgtransfer-deployment.yml | 4 +- deployments/deploy/openim-push-deployment.yml | 4 +- .../deploy/openim-rpc-auth-deployment.yml | 4 +- .../openim-rpc-conversation-deployment.yml | 4 +- .../deploy/openim-rpc-friend-deployment.yml | 7 ++-- .../deploy/openim-rpc-group-deployment.yml | 6 +-- .../deploy/openim-rpc-msg-deployment.yml | 6 +-- .../deploy/openim-rpc-third-deployment.yml | 6 +-- .../deploy/openim-rpc-user-deployment.yml | 6 +-- 15 files changed, 67 insertions(+), 69 deletions(-) create mode 100644 deployments/deploy/clusterRole.yml diff --git a/deployments/deploy/clusterRole.yml b/deployments/deploy/clusterRole.yml new file mode 100644 index 0000000000..328cb6c7ea --- /dev/null +++ b/deployments/deploy/clusterRole.yml @@ -0,0 +1,25 @@ +# ClusterRole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + # role name + name: service-reader +rules: + - apiGroups: [""] + resources: ["services"] + verbs: ["get", "list", "watch"] + +--- +# ClusterRoleBinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: default-service-reader-binding +subjects: + - kind: ServiceAccount + name: default + namespace: default +roleRef: + kind: ClusterRole + name: service-reader + apiGroup: rbac.authorization.k8s.io diff --git a/deployments/deploy/kafka-statefulset.yml b/deployments/deploy/kafka-statefulset.yml index 5672e6680a..cad5525fb2 100644 --- a/deployments/deploy/kafka-statefulset.yml +++ b/deployments/deploy/kafka-statefulset.yml @@ -47,18 +47,13 @@ spec: value: "CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT" - name: KAFKA_CFG_CONTROLLER_LISTENER_NAMES value: "CONTROLLER" - - name: KAFKA_NUM_PARTITIONS - value: "8" - name: KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE value: "true" volumeMounts: - name: kafka-data mountPath: /bitnami/kafka + volumes: - - name: kafka-scripts - configMap: - name: openim-config - defaultMode: 0755 - name: kafka-data persistentVolumeClaim: claimName: kafka-pvc diff --git a/deployments/deploy/mongo-statefulset.yml b/deployments/deploy/mongo-statefulset.yml index 77702fb46e..e4ea598ec3 100644 --- a/deployments/deploy/mongo-statefulset.yml +++ b/deployments/deploy/mongo-statefulset.yml @@ -16,35 +16,31 @@ spec: containers: - name: mongo image: mongo:7.0 - command: - [ - "/bin/bash", - "-c", - ' - docker-entrypoint.sh mongod --wiredTigerCacheSizeGB $wiredTigerCacheSizeGB --auth & - until mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin --eval "db.runCommand({ ping: 1 })" &>/dev/null; do - echo "Waiting for MongoDB to start..." - sleep 1 + command: ["/bin/bash", "-c"] + args: + - > + docker-entrypoint.sh mongod --wiredTigerCacheSizeGB ${wiredTigerCacheSizeGB} --auth & + until mongosh -u ${MONGO_INITDB_ROOT_USERNAME} -p ${MONGO_INITDB_ROOT_PASSWORD} --authenticationDatabase admin --eval "db.runCommand({ ping: 1 })" &>/dev/null; do + echo "Waiting for MongoDB to start..."; + sleep 1; done && - mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin --eval " - db = db.getSiblingDB(\"$MONGO_INITDB_DATABASE\"); - if (!db.getUser(\"$MONGO_OPENIM_USERNAME\")) { + mongosh -u ${MONGO_INITDB_ROOT_USERNAME} -p ${MONGO_INITDB_ROOT_PASSWORD} --authenticationDatabase admin --eval " + db = db.getSiblingDB(\"${MONGO_INITDB_DATABASE}\"); + if (!db.getUser(\"${MONGO_OPENIM_USERNAME}\")) { db.createUser({ - user: \"$MONGO_OPENIM_USERNAME\", - pwd: \"$MONGO_OPENIM_PASSWORD\", - roles: [{role: \"readWrite\", db: \"$MONGO_INITDB_DATABASE\"}] + user: \"${MONGO_OPENIM_USERNAME}\", + pwd: \"${MONGO_OPENIM_PASSWORD}\", + roles: [{role: \"readWrite\", db: \"${MONGO_INITDB_DATABASE}\"}] }); print(\"User created successfully: \"); - print(\"Username: $MONGO_OPENIM_USERNAME\"); - print(\"Password: $MONGO_OPENIM_PASSWORD\"); - print(\"Database: $MONGO_INITDB_DATABASE\"); + print(\"Username: ${MONGO_OPENIM_USERNAME}\"); + print(\"Password: ${MONGO_OPENIM_PASSWORD}\"); + print(\"Database: ${MONGO_INITDB_DATABASE}\"); } else { - print(\"User already exists in database: $MONGO_INITDB_DATABASE, Username: $MONGO_OPENIM_USERNAME\"); + print(\"User already exists in database: ${MONGO_INITDB_DATABASE}, Username: ${MONGO_OPENIM_USERNAME}\"); } " && tail -f /dev/null - ' - ] ports: - containerPort: 27017 env: @@ -73,6 +69,10 @@ spec: secretKeyRef: name: mongo-secret key: mongo_openim_password + - name: TZ + value: "Asia/Shanghai" + - name: wiredTigerCacheSizeGB + value: "1" volumeMounts: - name: mongo-storage mountPath: /data/db diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index 0ae628fb0b..b0d815d2d6 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -14,13 +14,11 @@ spec: spec: containers: - name: openim-api-container - image: openim/openim-api:v3.9 - # imagePullPolicy: Never + image: openim/openim-api:v3.8.3 + env: - name: CONFIG_PATH value: "/config" - - name: DEPLOYMENT_TYPE - value: "kubernetes" volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml index bdbff149c8..35fc08aceb 100644 --- a/deployments/deploy/openim-crontask-deployment.yml +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -14,12 +14,11 @@ spec: spec: containers: - name: crontask-container - image: openim/openim-crontask:v3.9 + image: openim/openim-crontask:v3.8.3 env: - name: CONFIG_PATH value: "/config" - - name: DEPLOYMENT_TYPE - value: "kubernetes" + volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index a2ce2ef16d..e053a8a414 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -14,12 +14,10 @@ spec: spec: containers: - name: openim-msggateway-container - image: openim/openim-msggateway:v3.9 + image: openim/openim-msggateway:v3.8.3 env: - name: CONFIG_PATH value: "/config" - - name: DEPLOYMENT_TYPE - value: "kubernetes" volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml index 264b478fa3..e2bcd754e9 100644 --- a/deployments/deploy/openim-msgtransfer-deployment.yml +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -14,12 +14,10 @@ spec: spec: containers: - name: openim-msgtransfer-container - image: openim/openim-msgtransfer:v3.9 + image: openim/openim-msgtransfer:v3.8.3 env: - name: CONFIG_PATH value: "/config" - - name: DEPLOYMENT_TYPE - value: "kubernetes" volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index 8c01eefc83..bd8d67424c 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -14,12 +14,10 @@ spec: spec: containers: - name: openim-push-container - image: openim/openim-push:v3.9 + image: openim/openim-push:v3.8.3 env: - name: CONFIG_PATH value: "/config" - - name: DEPLOYMENT_TYPE - value: "kubernetes" volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml index 89022a085b..e43d0cb56a 100644 --- a/deployments/deploy/openim-rpc-auth-deployment.yml +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: auth-rpc-server-container - image: openim/openim-rpc-auth:v3.9 + image: openim/openim-rpc-auth:v3.8.3 imagePullPolicy: Never env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" volumeMounts: diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index 4c09dee831..579079b17b 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: conversation-rpc-server-container - image: openim/openim-rpc-conversation:v3.9 + image: openim/openim-rpc-conversation:v3.8.3 imagePullPolicy: Never env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" volumeMounts: diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index 4829f7abdb..efc94cc559 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -14,11 +14,10 @@ spec: spec: containers: - name: friend-rpc-server-container - image: openim/openim-rpc-friend:v3.9 - # imagePullPolicy: Never + image: openim/openim-rpc-friend:v3.8.3 + env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" + - name: CONFIG_PATH value: "/config" - name: REDIS_PASSWORD diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index b4bb9792d8..c5fbf05869 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: group-rpc-server-container - image: openim/openim-rpc-group:v3.9 - # imagePullPolicy: Never + image: openim/openim-rpc-group:v3.8.3 + env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" volumeMounts: diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index ea9ff2131d..0001748f7e 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: msg-rpc-server-container - image: openim/openim-rpc-msg:v3.9 - # imagePullPolicy: Never + image: openim/openim-rpc-msg:v3.8.3 + env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" volumeMounts: diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index e1a33c780b..18fc83e3c8 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: third-rpc-server-container - image: openim/openim-rpc-third:v3.9 - # imagePullPolicy: Never + image: openim/openim-rpc-third:v3.8.3 + env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" - name: MINIO_ACCESS_KEY diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index 102faa3bec..b00f10b933 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -14,11 +14,9 @@ spec: spec: containers: - name: user-rpc-server-container - image: openim/openim-rpc-user:v3.9 - # imagePullPolicy: Never + image: openim/openim-rpc-user:v3.8.3 + env: - - name: DEPLOYMENT_TYPE - value: "kubernetes" - name: CONFIG_PATH value: "/config" volumeMounts: From 66b27b60e254e63d473d7182afe52b6ab49b5507 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Sat, 7 Dec 2024 18:17:03 +0800 Subject: [PATCH 21/33] update replica. --- deployments/deploy/kafka-statefulset.yml | 2 +- deployments/deploy/minio-statefulset.yml | 2 +- deployments/deploy/mongo-statefulset.yml | 2 +- deployments/deploy/openim-api-deployment.yml | 3 +-- deployments/deploy/openim-crontask-deployment.yml | 2 +- deployments/deploy/openim-msggateway-deployment.yml | 2 +- deployments/deploy/openim-msgtransfer-deployment.yml | 2 +- deployments/deploy/openim-push-deployment.yml | 2 +- deployments/deploy/openim-rpc-auth-deployment.yml | 2 +- deployments/deploy/openim-rpc-conversation-deployment.yml | 2 +- deployments/deploy/openim-rpc-friend-deployment.yml | 4 ++-- deployments/deploy/openim-rpc-group-deployment.yml | 2 +- deployments/deploy/openim-rpc-msg-deployment.yml | 2 +- deployments/deploy/openim-rpc-third-deployment.yml | 2 +- deployments/deploy/openim-rpc-user-deployment.yml | 2 +- deployments/deploy/redis-statefulset.yml | 2 +- 16 files changed, 17 insertions(+), 18 deletions(-) diff --git a/deployments/deploy/kafka-statefulset.yml b/deployments/deploy/kafka-statefulset.yml index cad5525fb2..0e3c78b69c 100644 --- a/deployments/deploy/kafka-statefulset.yml +++ b/deployments/deploy/kafka-statefulset.yml @@ -5,7 +5,7 @@ metadata: labels: app: kafka spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: kafka diff --git a/deployments/deploy/minio-statefulset.yml b/deployments/deploy/minio-statefulset.yml index f7028d8efe..7985f71f5d 100644 --- a/deployments/deploy/minio-statefulset.yml +++ b/deployments/deploy/minio-statefulset.yml @@ -5,7 +5,7 @@ metadata: labels: app: minio spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: minio diff --git a/deployments/deploy/mongo-statefulset.yml b/deployments/deploy/mongo-statefulset.yml index e4ea598ec3..e8510fdf7b 100644 --- a/deployments/deploy/mongo-statefulset.yml +++ b/deployments/deploy/mongo-statefulset.yml @@ -4,7 +4,7 @@ metadata: name: mongo-statefulset spec: serviceName: "mongo" - replicas: 1 + replicas: 2 selector: matchLabels: app: mongo diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index b0d815d2d6..1a51bfbc96 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: openim-api spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: openim-api @@ -15,7 +15,6 @@ spec: containers: - name: openim-api-container image: openim/openim-api:v3.8.3 - env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml index 35fc08aceb..207e2168fb 100644 --- a/deployments/deploy/openim-crontask-deployment.yml +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: openim-crontask spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: crontask diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index e053a8a414..fd0076479d 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: openim-msggateway-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: openim-msggateway-server diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml index e2bcd754e9..b3ee1f6b1b 100644 --- a/deployments/deploy/openim-msgtransfer-deployment.yml +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: openim-msgtransfer-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: openim-msgtransfer-server diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index bd8d67424c..7eee20654e 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: openim-push-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: openim-push-server diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml index e43d0cb56a..c6981d95c1 100644 --- a/deployments/deploy/openim-rpc-auth-deployment.yml +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: auth-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: auth-rpc-server diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index 579079b17b..a95ee5d297 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: conversation-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: conversation-rpc-server diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index efc94cc559..3e449f2e7f 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: friend-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: friend-rpc-server @@ -20,7 +20,7 @@ spec: - name: CONFIG_PATH value: "/config" - - name: REDIS_PASSWORD + - name: IMENV_REDIS_PASSWORD valueFrom: secretKeyRef: name: redis-secret diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index c5fbf05869..353c85bd8f 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: group-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: group-rpc-server diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index 0001748f7e..da9363853b 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: msg-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: msg-rpc-server diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index 18fc83e3c8..24337791b5 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: third-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: third-rpc-server diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index b00f10b933..1f3f6bd58a 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: user-rpc-server spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: user-rpc-server diff --git a/deployments/deploy/redis-statefulset.yml b/deployments/deploy/redis-statefulset.yml index a2f9d8cfcf..3f6dc41bcf 100644 --- a/deployments/deploy/redis-statefulset.yml +++ b/deployments/deploy/redis-statefulset.yml @@ -4,7 +4,7 @@ metadata: name: redis-statefulset spec: serviceName: "redis" - replicas: 1 + replicas: 2 selector: matchLabels: app: redis From 0a10fa2540dfaea21df5efad81a52499662f9227 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 10 Dec 2024 09:37:26 +0800 Subject: [PATCH 22/33] update deployment. --- config/openim-rpc-auth.yml | 1 - deployments/deploy/openim-api-deployment.yml | 9 +- deployments/deploy/openim-config.yml | 935 +++++++++--------- .../deploy/openim-msggateway-deployment.yml | 5 + .../deploy/openim-msggateway-service.yml | 6 +- .../deploy/openim-msgtransfer-deployment.yml | 11 +- .../deploy/openim-msgtransfer-service.yml | 1 - deployments/deploy/openim-push-deployment.yml | 5 + .../deploy/openim-rpc-auth-deployment.yml | 5 + .../openim-rpc-conversation-deployment.yml | 10 + .../deploy/openim-rpc-friend-deployment.yml | 9 +- .../deploy/openim-rpc-group-deployment.yml | 10 + .../deploy/openim-rpc-msg-deployment.yml | 13 +- .../deploy/openim-rpc-third-deployment.yml | 17 +- .../deploy/openim-rpc-user-deployment.yml | 11 +- 15 files changed, 591 insertions(+), 457 deletions(-) diff --git a/config/openim-rpc-auth.yml b/config/openim-rpc-auth.yml index 93f365386d..a386de097a 100644 --- a/config/openim-rpc-auth.yml +++ b/config/openim-rpc-auth.yml @@ -10,7 +10,6 @@ rpc: # It will only take effect when autoSetPorts is set to false. ports: [ 10200 ] - prometheus: # Enable or disable Prometheus monitoring enable: true diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index 1a51bfbc96..eab4fabd3b 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -17,11 +17,15 @@ spec: image: openim/openim-api:v3.8.3 env: - name: CONFIG_PATH - value: "/config" + value: "/config" volumeMounts: - name: openim-config mountPath: "/config" readOnly: true + - name: notification-config + mountPath: "/config/notification.yml" + subPath: notification.yml + readOnly: true ports: - containerPort: 10002 - containerPort: 12002 @@ -29,3 +33,6 @@ spec: - name: openim-config configMap: name: openim-config + - name: notification-config + configMap: + name: notification-config diff --git a/deployments/deploy/openim-config.yml b/deployments/deploy/openim-config.yml index cf87cfa072..f3962fcf12 100644 --- a/deployments/deploy/openim-config.yml +++ b/deployments/deploy/openim-config.yml @@ -5,6 +5,25 @@ metadata: data: discovery.yml: | enable: "kubernetes" + kubernetes: + namespace: default + etcd: + rootDirectory: openim + address: [ localhost:12379 ] + username: '' + password: '' + + rpcService: + user: user-rpc-service + friend: friend-rpc-service + msg: msg-rpc-service + push: push-rpc-service + messageGateway: messageGateway-rpc-service + group: group-rpc-service + auth: auth-rpc-service + conversation: conversation-rpc-service + third: third-rpc-service + log.yml: | # Log storage path, default is acceptable, change to a full path if modification is needed # storageLocation: ../../../../logs/ @@ -21,6 +40,7 @@ data: isJson: false # output simplify log when KeyAndValues's value len is bigger than 50 in rpc method log isSimplify: true + mongodb.yml: | # URI for database connection, leave empty if using address and credential settings directly uri: '' @@ -32,10 +52,13 @@ data: username: openIM # Password for database authentication password: openIM123 + # Authentication source for database authentication, if use root user, set it to admin + authSource: openim_v3 # Maximum number of connections in the connection pool maxPoolSize: 100 # Maximum number of retry attempts for a failed database connection maxRetry: 10 + local-cache.yml: | user: topic: DELETE_CACHE_USER @@ -63,12 +86,14 @@ data: failedExpire: 5 openim-api.yml: | - secret: openIM123 api: # Listening IP; 0.0.0.0 means both internal and external IPs are listened to, default is recommended listenIP: 0.0.0.0 # Listening ports; if multiple are configured, multiple instances will be launched, must be consistent with the number of prometheus.ports ports: [ 10002 ] + # API compression level; 0: default compression, 1: best compression, 2: best speed, -1: no compression + compressionLevel: 0 + prometheus: # Whether to enable prometheus enable: true @@ -76,13 +101,18 @@ data: ports: [ 12002 ] # This address can be accessed via a browser grafanaURL: http://127.0.0.1:13000/ + openim-rpc-user.yml: | rpc: # API or other RPCs can access this RPC through this IP; if left blank, the internal network IP is obtained by default - registerIP: '' + registerIP: # Listening IP; 0.0.0.0 means both internal and external IPs are listened to, if blank, the internal network IP is automatically obtained by default listenIP: 0.0.0.0 - # Listening ports; if multiple are configured, multiple instances will be launched, and must be consistent with the number of prometheus.ports + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. ports: [ 10320 ] prometheus: # Whether to enable prometheus @@ -93,20 +123,25 @@ data: openim-crontask.yml: | cronExecuteTime: 0 2 * * * retainChatRecords: 365 - fileExpireTime: 90 + fileExpireTime: 180 + deleteObjectType: ["msg-picture","msg-file", "msg-voice","msg-video","msg-video-snapshot","sdklog"] openim-msggateway.yml: | rpc: # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP registerIP: + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports - ports: [ 10140, 10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 10151, 10152, 10153, 10154, 10155 ] + # It will only take effect when autoSetPorts is set to false. + ports: [ 10140 ] prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup - ports: [ 12140, 12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 12152, 12153, 12154, 12155 ] + ports: [ 12140 ] # IP address that the RPC/WebSocket service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 @@ -127,50 +162,54 @@ data: enable: true # List of ports that Prometheus listens on; each port corresponds to an instance of monitoring. Ensure these are managed accordingly # Because four instances have been launched, four ports need to be specified - ports: [ 12020, 12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 12031, 12032, 12033, 12034, 12035 ] + ports: [ 12020 ] openim-push.yml: | rpc: - # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP - registerIP: - # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP - listenIP: 0.0.0.0 - # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports - ports: [ 10170, 10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 10181, 10182, 10183, 10184, 10185 ] - - prometheus: - # Enable or disable Prometheus monitoring - enable: true - # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup - ports: [ 12170, 12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12182, 12183, 12184, 12185, 12186 ] - - maxConcurrentWorkers: 3 - #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. - enable: geTui - geTui: - pushUrl: https://restapi.getui.com/v2/$appId - masterSecret: - appKey: - intent: - channelID: - channelName: - fcm: - # Prioritize using file paths. If the file path is empty, use URL - filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath. - authURL: # Must start with https or http. - jpns: - appKey: - masterSecret: - pushURL: - pushIntent: - - # iOS system push sound and badge count - iosPush: - pushSound: xxx - badgeCount: true - production: false - - fullUserCache: true + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: true + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. + ports: [ 10170 ] + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12170 ] + + maxConcurrentWorkers: 3 + #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. + enable: geTui + geTui: + pushUrl: https://restapi.getui.com/v2/$appId + masterSecret: + appKey: + intent: + channelID: + channelName: + fcm: + # Prioritize using file paths. If the file path is empty, use URL + filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath. + authURL: # Must start with https or http. + jpns: + appKey: + masterSecret: + pushURL: + pushIntent: + + # iOS system push sound and badge count + iosPush: + pushSound: xxx + badgeCount: true + production: false + + fullUserCache: true openim-rpc-auth.yml: | rpc: @@ -178,13 +217,19 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports - ports: [10200] + # It will only take effect when autoSetPorts is set to false. + ports: [ 10200 ] + prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup ports: [12200] + tokenPolicy: # Token validity period, in days expire: 90 @@ -195,14 +240,22 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports - ports: [ 10220 ] + # It will only take effect when autoSetPorts is set to false. + ports: [ 10200 ] prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup - ports: [ 12220 ] + ports: [ 12200 ] + + tokenPolicy: + # Token validity period, in days + expire: 90 openim-rpc-friend.yml: | rpc: @@ -210,7 +263,11 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. ports: [ 10240 ] prometheus: @@ -225,7 +282,11 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. ports: [ 10260 ] prometheus: @@ -242,6 +303,9 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports ports: [ 10280 ] @@ -261,7 +325,11 @@ data: registerIP: # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. ports: [ 10300 ] prometheus: @@ -296,19 +364,16 @@ data: accessKeySecret: sessionToken: publicRead: false + aws: + region: ap-southeast-2 + bucket: testdemo832234 + accessKeyID: + secretAccessKey: + sessionToken: + publicRead: false share.yml: | secret: openIM123 - rpcRegisterName: - user: user-rpc-service:10320 - friend: friend-rpc-service:10240 - msg: msg-rpc-service:10280 - push: openim-push-service - messageGateway: openim-msggateway-service - group: group-rpc-service:10260 - auth: auth-rpc-service:10200 - conversation: conversation-rpc-service:10220 - third: third-rpc-service:10300 imAdminUserID: ["imAdmin"] @@ -316,56 +381,67 @@ data: multiLogin: policy: 1 maxNumOneEnd: 30 - customizeLoginNum: - ios: 1 - android: 1 - windows: 1 - osx: 1 - web: 1 - miniWeb: 1 - linux: 1 - aPad: 1 - iPad: 1 - admin: 1 kafka.yml: | + # Username for authentication username: '' + # Password for authentication password: '' - producerAck: all + # Producer acknowledgment settings + producerAck: + # Compression type to use (e.g., none, gzip, snappy) compressType: none + # List of Kafka broker addresses address: [ "kafka-service:19094" ] + # Kafka topic for Redis integration toRedisTopic: toRedis + # Kafka topic for MongoDB integration toMongoTopic: toMongo + # Kafka topic for push notifications toPushTopic: toPush + # Kafka topic for offline push notifications toOfflinePushTopic: toOfflinePush + # Consumer group ID for Redis topic toRedisGroupID: redis + # Consumer group ID for MongoDB topic toMongoGroupID: mongo + # Consumer group ID for push notifications topic toPushGroupID: push + # Consumer group ID for offline push notifications topic toOfflinePushGroupID: offlinePush + # TLS (Transport Layer Security) configuration tls: + # Enable or disable TLS enableTLS: false + # CA certificate file path caCrt: + # Client certificate file path clientCrt: + # Client key file path clientKey: + # Client key password clientKeyPwd: + # Whether to skip TLS verification (not recommended for production) insecureSkipVerify: false + redis.yml: | address: [ "redis-service:16379" ] username: - password: openIM123 + password: # openIM123 clusterMode: false db: 0 maxRetry: 10 poolSize: 100 + minio.yml: | # Name of the bucket in MinIO bucket: openim # Access key ID for MinIO authentication - accessKeyID: root # ${MINIO_ACCESS_KEY} + accessKeyID: root # ${MINIO_ACCESS_KEY} # Secret access key for MinIO authentication - secretAccessKey: openIM123 # ${MINIO_SECRET_KEY} + secretAccessKey: # openIM123 # ${MINIO_SECRET_KEY} # Session token for MinIO authentication (optional) - sessionToken: "" + sessionToken: # Internal address of the MinIO server internalAddress: minio-service:10005 # External address of the MinIO server, accessible from outside. Supports both HTTP and HTTPS using a domain name @@ -373,340 +449,335 @@ data: # Flag to enable or disable public read access to the bucket publicRead: "false" - notification.yml: | - groupCreated: - isSendMsg: true - # Reliability level of the message sending. - # Set to 1 to send only when online, 2 for guaranteed delivery. - reliabilityLevel: 1 - # This setting is effective only when 'isSendMsg' is true. - # It controls whether to count unread messages. - unreadCount: false - # Configuration for offline push notifications. - offlinePush: - # Enables or disables offline push notifications. - enable: false - # Title for the notification when a group is created. - title: create group title - # Description for the notification. - desc: create group desc - # Additional information for the notification. - ext: create group ext - - groupInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSet title - desc: groupInfoSet desc - ext: groupInfoSet ext - - - joinGroupApplication: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: joinGroupApplication title - desc: joinGroupApplication desc - ext: joinGroupApplication ext - - memberQuit: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberQuit title - desc: memberQuit desc - ext: memberQuit ext - - groupApplicationAccepted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupApplicationAccepted title - desc: groupApplicationAccepted desc - ext: groupApplicationAccepted ext - - groupApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupApplicationRejected title - desc: groupApplicationRejected desc - ext: groupApplicationRejected ext - - - groupOwnerTransferred: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupOwnerTransferred title - desc: groupOwnerTransferred desc - ext: groupOwnerTransferred ext - - memberKicked: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberKicked title - desc: memberKicked desc - ext: memberKicked ext - - memberInvited: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberInvited title - desc: memberInvited desc - ext: memberInvited ext - - memberEnter: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberEnter title - desc: memberEnter desc - ext: memberEnter ext - - groupDismissed: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupDismissed title - desc: groupDismissed desc - ext: groupDismissed ext - - groupMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMuted title - desc: groupMuted desc - ext: groupMuted ext - - groupCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupCancelMuted title - desc: groupCancelMuted desc - ext: groupCancelMuted ext - defaultTips: - tips: group Cancel Muted - - - groupMemberMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberMuted title - desc: groupMemberMuted desc - ext: groupMemberMuted ext - - groupMemberCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberCancelMuted title - desc: groupMemberCancelMuted desc - ext: groupMemberCancelMuted ext - - groupMemberInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberInfoSet title - desc: groupMemberInfoSet desc - ext: groupMemberInfoSet ext - - groupInfoSetAnnouncement: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSetAnnouncement title - desc: groupInfoSetAnnouncement desc - ext: groupInfoSetAnnouncement ext - - - groupInfoSetName: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSetName title - desc: groupInfoSetName desc - ext: groupInfoSetName ext - - - #############################friend################################# - friendApplicationAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: Somebody applies to add you as a friend - desc: Somebody applies to add you as a friend - ext: Somebody applies to add you as a friend - - friendApplicationApproved: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Someone applies to add your friend application - desc: Someone applies to add your friend application - ext: Someone applies to add your friend application - - friendApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Someone rejected your friend application - desc: Someone rejected your friend application - ext: Someone rejected your friend application - - friendAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: We have become friends - desc: We have become friends - ext: We have become friends - - friendDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: deleted a friend - desc: deleted a friend - ext: deleted a friend - - friendRemarkSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Your friend's profile has been changed - desc: Your friend's profile has been changed - ext: Your friend's profile has been changed - - blackAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: blocked a user - desc: blocked a user - ext: blocked a user - - blackDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Remove a blocked user - desc: Remove a blocked user - ext: Remove a blocked user - - friendInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: friend info updated - desc: friend info updated - ext: friend info updated - - #####################user######################### - userInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: userInfo updated - desc: userInfo updated - ext: userInfo updated - - userStatusChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: user status changed - desc: user status changed - ext: user status changed - - #####################conversation######################### - conversationChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: conversation changed - desc: conversation changed - ext: conversation changed - - conversationSetPrivate: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: burn after reading - desc: burn after reading - ext: burn after reading + # notification.yml: | + # groupCreated: + # isSendMsg: true + # # Reliability level of the message sending. + # # Set to 1 to send only when online, 2 for guaranteed delivery. + # reliabilityLevel: 1 + # # This setting is effective only when 'isSendMsg' is true. + # # It controls whether to count unread messages. + # unreadCount: false + # # Configuration for offline push notifications. + # offlinePush: + # # Enables or disables offline push notifications. + # enable: false + # # Title for the notification when a group is created. + # title: create group title + # # Description for the notification. + # desc: create group desc + # # Additional information for the notification. + # ext: create group ext + + # groupInfoSet: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupInfoSet title + # desc: groupInfoSet desc + # ext: groupInfoSet ext + + # joinGroupApplication: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: joinGroupApplication title + # desc: joinGroupApplication desc + # ext: joinGroupApplication ext + + # memberQuit: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: memberQuit title + # desc: memberQuit desc + # ext: memberQuit ext + + # groupApplicationAccepted: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupApplicationAccepted title + # desc: groupApplicationAccepted desc + # ext: groupApplicationAccepted ext + + # groupApplicationRejected: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupApplicationRejected title + # desc: groupApplicationRejected desc + # ext: groupApplicationRejected ext + + # groupOwnerTransferred: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupOwnerTransferred title + # desc: groupOwnerTransferred desc + # ext: groupOwnerTransferred ext + + # memberKicked: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: memberKicked title + # desc: memberKicked desc + # ext: memberKicked ext + + # memberInvited: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: memberInvited title + # desc: memberInvited desc + # ext: memberInvited ext + + # memberEnter: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: memberEnter title + # desc: memberEnter desc + # ext: memberEnter ext + + # groupDismissed: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupDismissed title + # desc: groupDismissed desc + # ext: groupDismissed ext + + # groupMuted: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupMuted title + # desc: groupMuted desc + # ext: groupMuted ext + + # groupCancelMuted: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupCancelMuted title + # desc: groupCancelMuted desc + # ext: groupCancelMuted ext + # defaultTips: + # tips: group Cancel Muted + + # groupMemberMuted: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupMemberMuted title + # desc: groupMemberMuted desc + # ext: groupMemberMuted ext + + # groupMemberCancelMuted: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupMemberCancelMuted title + # desc: groupMemberCancelMuted desc + # ext: groupMemberCancelMuted ext + + # groupMemberInfoSet: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupMemberInfoSet title + # desc: groupMemberInfoSet desc + # ext: groupMemberInfoSet ext + + # groupInfoSetAnnouncement: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupInfoSetAnnouncement title + # desc: groupInfoSetAnnouncement desc + # ext: groupInfoSetAnnouncement ext + + # groupInfoSetName: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: groupInfoSetName title + # desc: groupInfoSetName desc + # ext: groupInfoSetName ext + + # #############################friend################################# + # friendApplicationAdded: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: Somebody applies to add you as a friend + # desc: Somebody applies to add you as a friend + # ext: Somebody applies to add you as a friend + + # friendApplicationApproved: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: Someone applies to add your friend application + # desc: Someone applies to add your friend application + # ext: Someone applies to add your friend application + + # friendApplicationRejected: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: Someone rejected your friend application + # desc: Someone rejected your friend application + # ext: Someone rejected your friend application + + # friendAdded: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: We have become friends + # desc: We have become friends + # ext: We have become friends + + # friendDeleted: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: deleted a friend + # desc: deleted a friend + # ext: deleted a friend + + # friendRemarkSet: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: Your friend's profile has been changed + # desc: Your friend's profile has been changed + # ext: Your friend's profile has been changed + + # blackAdded: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: blocked a user + # desc: blocked a user + # ext: blocked a user + + # blackDeleted: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: Remove a blocked user + # desc: Remove a blocked user + # ext: Remove a blocked user + + # friendInfoUpdated: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: friend info updated + # desc: friend info updated + # ext: friend info updated + + # #####################user######################### + # userInfoUpdated: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: userInfo updated + # desc: userInfo updated + # ext: userInfo updated + + # userStatusChanged: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: false + # title: user status changed + # desc: user status changed + # ext: user status changed + + # #####################conversation######################### + # conversationChanged: + # isSendMsg: false + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: conversation changed + # desc: conversation changed + # ext: conversation changed + + # conversationSetPrivate: + # isSendMsg: true + # reliabilityLevel: 1 + # unreadCount: false + # offlinePush: + # enable: true + # title: burn after reading + # desc: burn after reading + # ext: burn after reading prometheus.yml: | # my global config global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s). @@ -731,83 +802,63 @@ data: # prometheus fetches application services - job_name: node_exporter static_configs: - - targets: [internal_ip:20500] + - targets: [ internal_ip:20500 ] - job_name: openimserver-openim-api static_configs: - - targets: [internal_ip:12002] + - targets: [ internal_ip:12002 ] labels: namespace: default - job_name: openimserver-openim-msggateway static_configs: - - targets: [internal_ip:12140] - # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] + - targets: [ internal_ip:12140 ] + # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] labels: namespace: default - job_name: openimserver-openim-msgtransfer static_configs: - - targets: - [ - internal_ip:12020, - internal_ip:12021, - internal_ip:12022, - internal_ip:12023, - internal_ip:12024, - internal_ip:12025, - internal_ip:12026, - internal_ip:12027, - ] - # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] + - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027 ] + # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] labels: namespace: default - job_name: openimserver-openim-push static_configs: - - targets: - [ - internal_ip:12170, - internal_ip:12171, - internal_ip:12172, - internal_ip:12173, - internal_ip:12174, - internal_ip:12175, - internal_ip:12176, - internal_ip:12177, - ] - # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] + - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177 ] + # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] labels: namespace: default - job_name: openimserver-openim-rpc-auth static_configs: - - targets: [internal_ip:12200] + - targets: [ internal_ip:12200 ] labels: namespace: default - job_name: openimserver-openim-rpc-conversation static_configs: - - targets: [internal_ip:12220] + - targets: [ internal_ip:12220 ] labels: namespace: default - job_name: openimserver-openim-rpc-friend static_configs: - - targets: [internal_ip:12240] + - targets: [ internal_ip:12240 ] labels: namespace: default - job_name: openimserver-openim-rpc-group static_configs: - - targets: [internal_ip:12260] + - targets: [ internal_ip:12260 ] labels: namespace: default - job_name: openimserver-openim-rpc-msg static_configs: - - targets: [internal_ip:12280] + - targets: [ internal_ip:12280 ] labels: namespace: default - job_name: openimserver-openim-rpc-third static_configs: - - targets: [internal_ip:12300] + - targets: [ internal_ip:12300 ] labels: namespace: default - job_name: openimserver-openim-rpc-user static_configs: - - targets: [internal_ip:12320] + - targets: [ internal_ip:12320 ] labels: namespace: default @@ -1015,4 +1066,4 @@ data: mongo_initdb_root_password: b3BlbklNMTIz # base64 for "openIM123" mongo_initdb_database: b3BlbmltX3Yz # base64 for "openim_v3" mongo_openim_username: b3BlbklN # base64 for "openIM" - mongo_openim_password: b3BlbklNMTIz # base64 for "openIM123" + mongo_openim_password: b3BlbklNMTIz # base64 for "openIM123" \ No newline at end of file diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index fd0076479d..ace1493000 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -18,6 +18,11 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-msggateway-service.yml b/deployments/deploy/openim-msggateway-service.yml index 25af48c886..575b182057 100644 --- a/deployments/deploy/openim-msggateway-service.yml +++ b/deployments/deploy/openim-msggateway-service.yml @@ -6,10 +6,14 @@ spec: selector: app: openim-msggateway-server ports: - - name: http-10001 + - name: longConnServer-10001 protocol: TCP port: 10001 targetPort: 10001 + - name: http-12001 + protocol: TCP + port: 12001 + targetPort: 12001 - name: prometheus-12001 protocol: TCP port: 12001 diff --git a/deployments/deploy/openim-msgtransfer-deployment.yml b/deployments/deploy/openim-msgtransfer-deployment.yml index b3ee1f6b1b..be608845ca 100644 --- a/deployments/deploy/openim-msgtransfer-deployment.yml +++ b/deployments/deploy/openim-msgtransfer-deployment.yml @@ -18,12 +18,21 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" readOnly: true ports: - # - containerPort: 15200 - containerPort: 12020 volumes: - name: openim-config diff --git a/deployments/deploy/openim-msgtransfer-service.yml b/deployments/deploy/openim-msgtransfer-service.yml index a2eafd39fb..387208bb8d 100644 --- a/deployments/deploy/openim-msgtransfer-service.yml +++ b/deployments/deploy/openim-msgtransfer-service.yml @@ -6,7 +6,6 @@ spec: selector: app: openim-msgtransfer-server ports: - # TODO Need check port!!! - name: prometheus-12020 protocol: TCP port: 12020 diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index 7eee20654e..8b3da3f575 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -18,6 +18,11 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-auth-deployment.yml b/deployments/deploy/openim-rpc-auth-deployment.yml index c6981d95c1..b785ea92f6 100644 --- a/deployments/deploy/openim-rpc-auth-deployment.yml +++ b/deployments/deploy/openim-rpc-auth-deployment.yml @@ -19,6 +19,11 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index a95ee5d297..b0ca31f4b6 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -19,6 +19,16 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index 3e449f2e7f..18e5b9c236 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -14,10 +14,8 @@ spec: spec: containers: - name: friend-rpc-server-container - image: openim/openim-rpc-friend:v3.8.3 - + image: openim/openim-rpc-friend:v3.8.3 env: - - name: CONFIG_PATH value: "/config" - name: IMENV_REDIS_PASSWORD @@ -25,6 +23,11 @@ spec: secretKeyRef: name: redis-secret key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index 353c85bd8f..2ffa4f58e1 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -19,6 +19,16 @@ spec: env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index da9363853b..aa6db38cc5 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -14,11 +14,20 @@ spec: spec: containers: - name: msg-rpc-server-container - image: openim/openim-rpc-msg:v3.8.3 - + image: openim/openim-rpc-msg:v3.8.3 env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index 24337791b5..2173f460c0 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -14,17 +14,26 @@ spec: spec: containers: - name: third-rpc-server-container - image: openim/openim-rpc-third:v3.8.3 - + image: openim/openim-rpc-third:v3.8.3 env: - name: CONFIG_PATH value: "/config" - - name: MINIO_ACCESS_KEY + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password + - name: IMENV_MINIO_ACCESSKEYID valueFrom: secretKeyRef: name: minio-secret key: minio-root-user - - name: MINIO_SECRET_KEY + - name: IMENV_MINIO_SECRETACCESSKEY valueFrom: secretKeyRef: name: minio-secret diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index 1f3f6bd58a..945351d89d 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -15,10 +15,19 @@ spec: containers: - name: user-rpc-server-container image: openim/openim-rpc-user:v3.8.3 - env: - name: CONFIG_PATH value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" From 472f4a28dfdd2a56e89b5d6b57f1f9f7112bd2ec Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 10 Dec 2024 18:19:06 +0800 Subject: [PATCH 23/33] remove notfication config. --- deployments/deploy/openim-api-deployment.yml | 9 +- deployments/deploy/openim-config.yml | 741 +++++++++--------- deployments/deploy/openim-push-deployment.yml | 7 - .../openim-rpc-conversation-deployment.yml | 7 - .../deploy/openim-rpc-friend-deployment.yml | 9 +- .../deploy/openim-rpc-group-deployment.yml | 9 +- .../deploy/openim-rpc-msg-deployment.yml | 9 +- .../deploy/openim-rpc-third-deployment.yml | 7 - .../deploy/openim-rpc-user-deployment.yml | 7 - 9 files changed, 375 insertions(+), 430 deletions(-) diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index eab4fabd3b..7dc2f7d082 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -22,17 +22,10 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10002 - containerPort: 12002 volumes: - name: openim-config configMap: - name: openim-config - - name: notification-config - configMap: - name: notification-config + name: openim-config \ No newline at end of file diff --git a/deployments/deploy/openim-config.yml b/deployments/deploy/openim-config.yml index f3962fcf12..679b15c0e8 100644 --- a/deployments/deploy/openim-config.yml +++ b/deployments/deploy/openim-config.yml @@ -14,11 +14,11 @@ data: password: '' rpcService: + messageGateway: messageGateway-rpc-service user: user-rpc-service friend: friend-rpc-service msg: msg-rpc-service push: push-rpc-service - messageGateway: messageGateway-rpc-service group: group-rpc-service auth: auth-rpc-service conversation: conversation-rpc-service @@ -166,50 +166,51 @@ data: openim-push.yml: | rpc: - # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP - registerIP: - # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP - listenIP: 0.0.0.0 - # autoSetPorts indicates whether to automatically set the ports - # if you use in kubernetes, set it to false - autoSetPorts: true - # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports - # It will only take effect when autoSetPorts is set to false. - ports: [ 10170 ] - - prometheus: - # Enable or disable Prometheus monitoring - enable: true - # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup - ports: [ 12170 ] - - maxConcurrentWorkers: 3 - #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. - enable: geTui - geTui: - pushUrl: https://restapi.getui.com/v2/$appId - masterSecret: - appKey: - intent: - channelID: - channelName: - fcm: - # Prioritize using file paths. If the file path is empty, use URL - filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath. - authURL: # Must start with https or http. - jpns: - appKey: - masterSecret: - pushURL: - pushIntent: - - # iOS system push sound and badge count - iosPush: - pushSound: xxx - badgeCount: true - production: false - - fullUserCache: true + # The IP address where this RPC service registers itself; if left blank, it defaults to the internal network IP + registerIP: + # IP address that the RPC service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP + listenIP: 0.0.0.0 + # autoSetPorts indicates whether to automatically set the ports + # if you use in kubernetes, set it to false + autoSetPorts: false + # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports + # It will only take effect when autoSetPorts is set to false. + ports: [ 10170 ] + + + prometheus: + # Enable or disable Prometheus monitoring + enable: true + # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup + ports: [ 12170 ] + + maxConcurrentWorkers: 3 + #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. + enable: + geTui: + pushUrl: https://restapi.getui.com/v2/$appId + masterSecret: + appKey: + intent: + channelID: + channelName: + fcm: + # Prioritize using file paths. If the file path is empty, use URL + filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath. + authURL: # Must start with https or http. + jpush: + appKey: + masterSecret: + pushURL: + pushIntent: + + # iOS system push sound and badge count + iosPush: + pushSound: xxx + badgeCount: true + production: false + + fullUserCache: true openim-rpc-auth.yml: | rpc: @@ -245,7 +246,7 @@ data: autoSetPorts: false # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10200 ] + ports: [ 10220 ] prometheus: # Enable or disable Prometheus monitoring @@ -449,330 +450,330 @@ data: # Flag to enable or disable public read access to the bucket publicRead: "false" - # notification.yml: | - # groupCreated: - # isSendMsg: true - # # Reliability level of the message sending. - # # Set to 1 to send only when online, 2 for guaranteed delivery. - # reliabilityLevel: 1 - # # This setting is effective only when 'isSendMsg' is true. - # # It controls whether to count unread messages. - # unreadCount: false - # # Configuration for offline push notifications. - # offlinePush: - # # Enables or disables offline push notifications. - # enable: false - # # Title for the notification when a group is created. - # title: create group title - # # Description for the notification. - # desc: create group desc - # # Additional information for the notification. - # ext: create group ext - - # groupInfoSet: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupInfoSet title - # desc: groupInfoSet desc - # ext: groupInfoSet ext - - # joinGroupApplication: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: joinGroupApplication title - # desc: joinGroupApplication desc - # ext: joinGroupApplication ext - - # memberQuit: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: memberQuit title - # desc: memberQuit desc - # ext: memberQuit ext - - # groupApplicationAccepted: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupApplicationAccepted title - # desc: groupApplicationAccepted desc - # ext: groupApplicationAccepted ext - - # groupApplicationRejected: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupApplicationRejected title - # desc: groupApplicationRejected desc - # ext: groupApplicationRejected ext - - # groupOwnerTransferred: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupOwnerTransferred title - # desc: groupOwnerTransferred desc - # ext: groupOwnerTransferred ext - - # memberKicked: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: memberKicked title - # desc: memberKicked desc - # ext: memberKicked ext - - # memberInvited: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: memberInvited title - # desc: memberInvited desc - # ext: memberInvited ext - - # memberEnter: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: memberEnter title - # desc: memberEnter desc - # ext: memberEnter ext - - # groupDismissed: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupDismissed title - # desc: groupDismissed desc - # ext: groupDismissed ext - - # groupMuted: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupMuted title - # desc: groupMuted desc - # ext: groupMuted ext - - # groupCancelMuted: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupCancelMuted title - # desc: groupCancelMuted desc - # ext: groupCancelMuted ext - # defaultTips: - # tips: group Cancel Muted - - # groupMemberMuted: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupMemberMuted title - # desc: groupMemberMuted desc - # ext: groupMemberMuted ext - - # groupMemberCancelMuted: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupMemberCancelMuted title - # desc: groupMemberCancelMuted desc - # ext: groupMemberCancelMuted ext - - # groupMemberInfoSet: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupMemberInfoSet title - # desc: groupMemberInfoSet desc - # ext: groupMemberInfoSet ext - - # groupInfoSetAnnouncement: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupInfoSetAnnouncement title - # desc: groupInfoSetAnnouncement desc - # ext: groupInfoSetAnnouncement ext - - # groupInfoSetName: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: groupInfoSetName title - # desc: groupInfoSetName desc - # ext: groupInfoSetName ext - - # #############################friend################################# - # friendApplicationAdded: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: Somebody applies to add you as a friend - # desc: Somebody applies to add you as a friend - # ext: Somebody applies to add you as a friend - - # friendApplicationApproved: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: Someone applies to add your friend application - # desc: Someone applies to add your friend application - # ext: Someone applies to add your friend application - - # friendApplicationRejected: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: Someone rejected your friend application - # desc: Someone rejected your friend application - # ext: Someone rejected your friend application - - # friendAdded: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: We have become friends - # desc: We have become friends - # ext: We have become friends - - # friendDeleted: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: deleted a friend - # desc: deleted a friend - # ext: deleted a friend - - # friendRemarkSet: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: Your friend's profile has been changed - # desc: Your friend's profile has been changed - # ext: Your friend's profile has been changed - - # blackAdded: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: blocked a user - # desc: blocked a user - # ext: blocked a user - - # blackDeleted: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: Remove a blocked user - # desc: Remove a blocked user - # ext: Remove a blocked user - - # friendInfoUpdated: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: friend info updated - # desc: friend info updated - # ext: friend info updated - - # #####################user######################### - # userInfoUpdated: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: userInfo updated - # desc: userInfo updated - # ext: userInfo updated - - # userStatusChanged: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: false - # title: user status changed - # desc: user status changed - # ext: user status changed - - # #####################conversation######################### - # conversationChanged: - # isSendMsg: false - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: conversation changed - # desc: conversation changed - # ext: conversation changed - - # conversationSetPrivate: - # isSendMsg: true - # reliabilityLevel: 1 - # unreadCount: false - # offlinePush: - # enable: true - # title: burn after reading - # desc: burn after reading - # ext: burn after reading + notification.yml: | + groupCreated: + isSendMsg: true + # Reliability level of the message sending. + # Set to 1 to send only when online, 2 for guaranteed delivery. + reliabilityLevel: 1 + # This setting is effective only when 'isSendMsg' is true. + # It controls whether to count unread messages. + unreadCount: false + # Configuration for offline push notifications. + offlinePush: + # Enables or disables offline push notifications. + enable: false + # Title for the notification when a group is created. + title: create group title + # Description for the notification. + desc: create group desc + # Additional information for the notification. + ext: create group ext + + groupInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSet title + desc: groupInfoSet desc + ext: groupInfoSet ext + + joinGroupApplication: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: joinGroupApplication title + desc: joinGroupApplication desc + ext: joinGroupApplication ext + + memberQuit: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberQuit title + desc: memberQuit desc + ext: memberQuit ext + + groupApplicationAccepted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationAccepted title + desc: groupApplicationAccepted desc + ext: groupApplicationAccepted ext + + groupApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupApplicationRejected title + desc: groupApplicationRejected desc + ext: groupApplicationRejected ext + + groupOwnerTransferred: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupOwnerTransferred title + desc: groupOwnerTransferred desc + ext: groupOwnerTransferred ext + + memberKicked: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberKicked title + desc: memberKicked desc + ext: memberKicked ext + + memberInvited: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberInvited title + desc: memberInvited desc + ext: memberInvited ext + + memberEnter: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: memberEnter title + desc: memberEnter desc + ext: memberEnter ext + + groupDismissed: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupDismissed title + desc: groupDismissed desc + ext: groupDismissed ext + + groupMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMuted title + desc: groupMuted desc + ext: groupMuted ext + + groupCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupCancelMuted title + desc: groupCancelMuted desc + ext: groupCancelMuted ext + defaultTips: + tips: group Cancel Muted + + groupMemberMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberMuted title + desc: groupMemberMuted desc + ext: groupMemberMuted ext + + groupMemberCancelMuted: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberCancelMuted title + desc: groupMemberCancelMuted desc + ext: groupMemberCancelMuted ext + + groupMemberInfoSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupMemberInfoSet title + desc: groupMemberInfoSet desc + ext: groupMemberInfoSet ext + + groupInfoSetAnnouncement: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetAnnouncement title + desc: groupInfoSetAnnouncement desc + ext: groupInfoSetAnnouncement ext + + groupInfoSetName: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: groupInfoSetName title + desc: groupInfoSetName desc + ext: groupInfoSetName ext + + #############################friend################################# + friendApplicationAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: Somebody applies to add you as a friend + desc: Somebody applies to add you as a friend + ext: Somebody applies to add you as a friend + + friendApplicationApproved: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone applies to add your friend application + desc: Someone applies to add your friend application + ext: Someone applies to add your friend application + + friendApplicationRejected: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Someone rejected your friend application + desc: Someone rejected your friend application + ext: Someone rejected your friend application + + friendAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: We have become friends + desc: We have become friends + ext: We have become friends + + friendDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: deleted a friend + desc: deleted a friend + ext: deleted a friend + + friendRemarkSet: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Your friend's profile has been changed + desc: Your friend's profile has been changed + ext: Your friend's profile has been changed + + blackAdded: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: blocked a user + desc: blocked a user + ext: blocked a user + + blackDeleted: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: Remove a blocked user + desc: Remove a blocked user + ext: Remove a blocked user + + friendInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: friend info updated + desc: friend info updated + ext: friend info updated + + #####################user######################### + userInfoUpdated: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: userInfo updated + desc: userInfo updated + ext: userInfo updated + + userStatusChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: false + title: user status changed + desc: user status changed + ext: user status changed + + #####################conversation######################### + conversationChanged: + isSendMsg: false + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: conversation changed + desc: conversation changed + ext: conversation changed + + conversationSetPrivate: + isSendMsg: true + reliabilityLevel: 1 + unreadCount: false + offlinePush: + enable: true + title: burn after reading + desc: burn after reading + ext: burn after reading prometheus.yml: | # my global config diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index 8b3da3f575..b7a38f0855 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -27,10 +27,6 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10170 - containerPort: 12170 @@ -38,6 +34,3 @@ spec: - name: openim-config configMap: name: openim-config - - name: notification-config - configMap: - name: notification-config diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index b0ca31f4b6..f29977ba3a 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -33,10 +33,6 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10220 - containerPort: 12220 @@ -44,6 +40,3 @@ spec: - name: openim-config configMap: name: openim-config - - name: notification-config - configMap: - name: notification-config diff --git a/deployments/deploy/openim-rpc-friend-deployment.yml b/deployments/deploy/openim-rpc-friend-deployment.yml index 18e5b9c236..5fdd3bf62b 100644 --- a/deployments/deploy/openim-rpc-friend-deployment.yml +++ b/deployments/deploy/openim-rpc-friend-deployment.yml @@ -32,17 +32,10 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10240 - containerPort: 12240 volumes: - name: openim-config configMap: - name: openim-config - - name: notification-config - configMap: - name: notification-config + name: openim-config \ No newline at end of file diff --git a/deployments/deploy/openim-rpc-group-deployment.yml b/deployments/deploy/openim-rpc-group-deployment.yml index 2ffa4f58e1..313fec897e 100644 --- a/deployments/deploy/openim-rpc-group-deployment.yml +++ b/deployments/deploy/openim-rpc-group-deployment.yml @@ -33,17 +33,10 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10260 - containerPort: 12260 volumes: - name: openim-config configMap: - name: openim-config - - name: notification-config - configMap: - name: notification-config + name: openim-config \ No newline at end of file diff --git a/deployments/deploy/openim-rpc-msg-deployment.yml b/deployments/deploy/openim-rpc-msg-deployment.yml index aa6db38cc5..e883f5849f 100644 --- a/deployments/deploy/openim-rpc-msg-deployment.yml +++ b/deployments/deploy/openim-rpc-msg-deployment.yml @@ -32,17 +32,10 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10280 - containerPort: 12280 volumes: - name: openim-config configMap: - name: openim-config - - name: notification-config - configMap: - name: notification-config + name: openim-config \ No newline at end of file diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index 2173f460c0..997f032bd0 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -42,10 +42,6 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10300 - containerPort: 12300 @@ -53,6 +49,3 @@ spec: - name: openim-config configMap: name: openim-config - - name: notification-config - configMap: - name: notification-config diff --git a/deployments/deploy/openim-rpc-user-deployment.yml b/deployments/deploy/openim-rpc-user-deployment.yml index 945351d89d..c6a47e1257 100644 --- a/deployments/deploy/openim-rpc-user-deployment.yml +++ b/deployments/deploy/openim-rpc-user-deployment.yml @@ -32,10 +32,6 @@ spec: - name: openim-config mountPath: "/config" readOnly: true - - name: notification-config - mountPath: "/config/notification.yml" - subPath: notification.yml - readOnly: true ports: - containerPort: 10320 - containerPort: 12320 @@ -43,6 +39,3 @@ spec: - name: openim-config configMap: name: openim-config - - name: notification-config - configMap: - name: notification-config From a8fad3050718a9c362053c374b8251e9e946dc38 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 10 Dec 2024 18:19:54 +0800 Subject: [PATCH 24/33] remove notification and zookeeper. --- deployments/deploy/README.md | 2 +- deployments/deploy/notification-config.yml | 334 ------------------ pkg/common/discoveryregister/zookeeper/doc.go | 15 - 3 files changed, 1 insertion(+), 350 deletions(-) delete mode 100644 deployments/deploy/notification-config.yml delete mode 100644 pkg/common/discoveryregister/zookeeper/doc.go diff --git a/deployments/deploy/README.md b/deployments/deploy/README.md index 577c183a18..0fa8697c86 100644 --- a/deployments/deploy/README.md +++ b/deployments/deploy/README.md @@ -12,7 +12,7 @@ 2. Deploy configs and dependencies Apply all config and dependencies -`kubectl apply -f ./openim-config.yml -f ./notification-config.yml -f ./kafka-service.yml` +`kubectl apply -f ./openim-config.yml -f ` Run infrasturcture components. diff --git a/deployments/deploy/notification-config.yml b/deployments/deploy/notification-config.yml deleted file mode 100644 index 0f45616b02..0000000000 --- a/deployments/deploy/notification-config.yml +++ /dev/null @@ -1,334 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: notification-config -data: - notification.yml: | - groupCreated: - isSendMsg: true - # Reliability level of the message sending. - # Set to 1 to send only when online, 2 for guaranteed delivery. - reliabilityLevel: 1 - # This setting is effective only when 'isSendMsg' is true. - # It controls whether to count unread messages. - unreadCount: false - # Configuration for offline push notifications. - offlinePush: - # Enables or disables offline push notifications. - enable: false - # Title for the notification when a group is created. - title: create group title - # Description for the notification. - desc: create group desc - # Additional information for the notification. - ext: create group ext - - groupInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSet title - desc: groupInfoSet desc - ext: groupInfoSet ext - - - joinGroupApplication: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: joinGroupApplication title - desc: joinGroupApplication desc - ext: joinGroupApplication ext - - memberQuit: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberQuit title - desc: memberQuit desc - ext: memberQuit ext - - groupApplicationAccepted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupApplicationAccepted title - desc: groupApplicationAccepted desc - ext: groupApplicationAccepted ext - - groupApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupApplicationRejected title - desc: groupApplicationRejected desc - ext: groupApplicationRejected ext - - - groupOwnerTransferred: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupOwnerTransferred title - desc: groupOwnerTransferred desc - ext: groupOwnerTransferred ext - - memberKicked: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberKicked title - desc: memberKicked desc - ext: memberKicked ext - - memberInvited: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberInvited title - desc: memberInvited desc - ext: memberInvited ext - - memberEnter: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: memberEnter title - desc: memberEnter desc - ext: memberEnter ext - - groupDismissed: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupDismissed title - desc: groupDismissed desc - ext: groupDismissed ext - - groupMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMuted title - desc: groupMuted desc - ext: groupMuted ext - - groupCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupCancelMuted title - desc: groupCancelMuted desc - ext: groupCancelMuted ext - defaultTips: - tips: group Cancel Muted - - - groupMemberMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberMuted title - desc: groupMemberMuted desc - ext: groupMemberMuted ext - - groupMemberCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberCancelMuted title - desc: groupMemberCancelMuted desc - ext: groupMemberCancelMuted ext - - groupMemberInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupMemberInfoSet title - desc: groupMemberInfoSet desc - ext: groupMemberInfoSet ext - - groupInfoSetAnnouncement: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSetAnnouncement title - desc: groupInfoSetAnnouncement desc - ext: groupInfoSetAnnouncement ext - - - groupInfoSetName: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: groupInfoSetName title - desc: groupInfoSetName desc - ext: groupInfoSetName ext - - - #############################friend################################# - friendApplicationAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: Somebody applies to add you as a friend - desc: Somebody applies to add you as a friend - ext: Somebody applies to add you as a friend - - friendApplicationApproved: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Someone applies to add your friend application - desc: Someone applies to add your friend application - ext: Someone applies to add your friend application - - friendApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Someone rejected your friend application - desc: Someone rejected your friend application - ext: Someone rejected your friend application - - friendAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: We have become friends - desc: We have become friends - ext: We have become friends - - friendDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: deleted a friend - desc: deleted a friend - ext: deleted a friend - - friendRemarkSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Your friend's profile has been changed - desc: Your friend's profile has been changed - ext: Your friend's profile has been changed - - blackAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: blocked a user - desc: blocked a user - ext: blocked a user - - blackDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: Remove a blocked user - desc: Remove a blocked user - ext: Remove a blocked user - - friendInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: friend info updated - desc: friend info updated - ext: friend info updated - - #####################user######################### - userInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: userInfo updated - desc: userInfo updated - ext: userInfo updated - - userStatusChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: user status changed - desc: user status changed - ext: user status changed - - #####################conversation######################### - conversationChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: conversation changed - desc: conversation changed - ext: conversation changed - - conversationSetPrivate: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: burn after reading - desc: burn after reading - ext: burn after reading diff --git a/pkg/common/discoveryregister/zookeeper/doc.go b/pkg/common/discoveryregister/zookeeper/doc.go deleted file mode 100644 index 1c24d77ac9..0000000000 --- a/pkg/common/discoveryregister/zookeeper/doc.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2024 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package zookeeper // import "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper" From fbaa7792ca826608536ea5b30af7ae256e17ad7f Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:01:45 +0800 Subject: [PATCH 25/33] update discovery in kubernetes. --- go.mod | 2 +- go.sum | 4 +- internal/msggateway/ws_server.go | 9 +- internal/push/onlinepusher.go | 20 ++- internal/push/push.go | 5 + pkg/common/config/constant.go | 1 + .../discoveryregister/discoveryregister.go | 13 +- .../kubernetes/kubernetes.go | 166 ++++++++---------- 8 files changed, 105 insertions(+), 115 deletions(-) diff --git a/go.mod b/go.mod index 53392f7396..3398349bea 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/protocol v0.0.72-alpha.61 - github.com/openimsdk/tools v0.0.50-alpha.46 + github.com/openimsdk/tools v0.0.50-alpha.51 github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.18.0 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 9bfbb38fbf..2f1dfcfdae 100644 --- a/go.sum +++ b/go.sum @@ -349,8 +349,8 @@ github.com/openimsdk/gomake v0.0.15-alpha.2 h1:5Q8yl8ezy2yx+q8/ucU/t4kJnDfCzNOrk github.com/openimsdk/gomake v0.0.15-alpha.2/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.72-alpha.61 h1:RuZR9/Sg3p6Bpb2CKPjPoA2AUmTvHITmhZ3PT/RbWMs= github.com/openimsdk/protocol v0.0.72-alpha.61/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M= -github.com/openimsdk/tools v0.0.50-alpha.46 h1:j3HxPxhDptVHwr7eChL2rCH8mKfpUEcr4nHi5k4yDME= -github.com/openimsdk/tools v0.0.50-alpha.46/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= +github.com/openimsdk/tools v0.0.50-alpha.51 h1:M3dMUoHjggx5Ry6XSkK0FTSJmRQjjkSBpuzXiFzKtC4= +github.com/openimsdk/tools v0.0.50-alpha.51/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= diff --git a/internal/msggateway/ws_server.go b/internal/msggateway/ws_server.go index 335556ae99..2e23262b12 100644 --- a/internal/msggateway/ws_server.go +++ b/internal/msggateway/ws_server.go @@ -3,15 +3,16 @@ package msggateway import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/rpccache" - pbAuth "github.com/openimsdk/protocol/auth" - "github.com/openimsdk/tools/mcontext" "net/http" "sync" "sync/atomic" "time" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/open-im-server/v3/pkg/rpccache" + pbAuth "github.com/openimsdk/protocol/auth" + "github.com/openimsdk/tools/mcontext" + "github.com/go-playground/validator/v10" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" diff --git a/internal/push/onlinepusher.go b/internal/push/onlinepusher.go index f1ff7fed50..23e68339c5 100644 --- a/internal/push/onlinepusher.go +++ b/internal/push/onlinepusher.go @@ -2,14 +2,19 @@ package push import ( "context" + "errors" + "sync" + "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "golang.org/x/sync/errgroup" "google.golang.org/grpc" - "sync" + + conf "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type OnlinePusher interface { @@ -37,15 +42,16 @@ func (u emptyOnlinePusher) GetOnlinePushFailedUserIDs(ctx context.Context, msg * } func NewOnlinePusher(disCov discovery.SvcDiscoveryRegistry, config *Config) OnlinePusher { - switch config.Discovery.Enable { - case "k8s": - return NewK8sStaticConsistentHash(disCov, config) - case "zookeeper": + + if config.runTimeEnv == conf.KUBERNETES { return NewDefaultAllNode(disCov, config) - case "etcd": + } + switch config.Discovery.Enable { + case conf.ETCD: return NewDefaultAllNode(disCov, config) default: - return newEmptyOnlinePusher() + log.ZError(context.Background(), "NewOnlinePusher is error", errs.Wrap(errors.New("unsupported discovery type")), "type", config.Discovery.Enable) + return nil } } diff --git a/internal/push/push.go b/internal/push/push.go index 7f14bced7b..74a4a0a4aa 100644 --- a/internal/push/push.go +++ b/internal/push/push.go @@ -10,6 +10,7 @@ import ( pbpush "github.com/openimsdk/protocol/push" "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/utils/runtimeenv" "google.golang.org/grpc" ) @@ -32,6 +33,8 @@ type Config struct { LocalCacheConfig config.LocalCache Discovery config.Discovery FcmConfigPath string + + runTimeEnv string } func (p pushServer) PushMsg(ctx context.Context, req *pbpush.PushMsgReq) (*pbpush.PushMsgResp, error) { @@ -48,6 +51,8 @@ func (p pushServer) DelUserPushToken(ctx context.Context, } func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error { + config.runTimeEnv = runtimeenv.PrintRuntimeEnvironment() + rdb, err := redisutil.NewRedisClient(ctx, config.RedisConfig.Build()) if err != nil { return err diff --git a/pkg/common/config/constant.go b/pkg/common/config/constant.go index 9aeaedca9f..f3fcc67ef0 100644 --- a/pkg/common/config/constant.go +++ b/pkg/common/config/constant.go @@ -20,6 +20,7 @@ const ( MountConfigFilePath = "CONFIG_PATH" DeploymentType = "DEPLOYMENT_TYPE" KUBERNETES = "kubernetes" + ETCD = "etcd" ) const ( diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 419293a919..ae4229e1b5 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -19,6 +19,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/tools/discovery" + "google.golang.org/grpc" "github.com/openimsdk/tools/discovery/kubernetes" @@ -28,14 +29,16 @@ import ( // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. func NewDiscoveryRegister(discovery *config.Discovery, runtimeEnv string) (discovery.SvcDiscoveryRegistry, error) { - if runtimeEnv == "kubernetes" { - discovery.Enable = "kubernetes" + if runtimeEnv == config.KUBERNETES { + return kubernetes.NewKubernetesConnManager(discovery.Kubernetes.Namespace, + grpc.WithDefaultCallOptions( + grpc.MaxCallSendMsgSize(1024*1024*20), + ), + ) } switch discovery.Enable { - case "kubernetes": - return kubernetes.NewKubernetesConnManager(discovery.Kubernetes.Namespace) - case "etcd": + case config.ETCD: return etcd.NewSvcDiscoveryRegistry( discovery.Etcd.RootDirectory, discovery.Etcd.Address, diff --git a/pkg/common/discoveryregister/kubernetes/kubernetes.go b/pkg/common/discoveryregister/kubernetes/kubernetes.go index cf6a904be4..459f20e0b2 100644 --- a/pkg/common/discoveryregister/kubernetes/kubernetes.go +++ b/pkg/common/discoveryregister/kubernetes/kubernetes.go @@ -1,22 +1,10 @@ -// Copyright © 2023 OpenIM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - package kubernetes import ( "context" "fmt" + "log" + "os" "sync" "time" @@ -35,6 +23,7 @@ type KubernetesConnManager struct { namespace string dialOptions []grpc.DialOption + rpcTargets map[string]string selfTarget string mu sync.RWMutex @@ -76,11 +65,14 @@ func (k *KubernetesConnManager) initializeConns(serviceName string) error { return fmt.Errorf("failed to get endpoints for service %s: %v", serviceName, err) } + // fmt.Println("Endpoints:", endpoints, "endpoints.Subsets:", endpoints.Subsets) + var conns []*grpc.ClientConn for _, subset := range endpoints.Subsets { for _, address := range subset.Addresses { target := fmt.Sprintf("%s:%d", address.IP, port) - conn, err := grpc.Dial(target, grpc.WithTransportCredentials(insecure.NewCredentials())) + // fmt.Println("IP target:", target) + conn, err := grpc.Dial(target, append(k.dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))...) if err != nil { return fmt.Errorf("failed to dial endpoint %s: %v", target, err) } @@ -89,10 +81,8 @@ func (k *KubernetesConnManager) initializeConns(serviceName string) error { } k.mu.Lock() - defer k.mu.Unlock() k.connMap[serviceName] = conns - - // go k.watchEndpoints(serviceName) + k.mu.Unlock() return nil } @@ -100,23 +90,23 @@ func (k *KubernetesConnManager) initializeConns(serviceName string) error { // GetConns returns gRPC client connections for a given Kubernetes service name. func (k *KubernetesConnManager) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) { k.mu.RLock() - conns, exists := k.connMap[serviceName] - defer k.mu.RUnlock() + conns, exists := k.connMap[serviceName] + k.mu.RUnlock() if exists { return conns, nil } k.mu.Lock() - defer k.mu.Unlock() - // Check if another goroutine has already initialized the connections when we released the read lock conns, exists = k.connMap[serviceName] if exists { return conns, nil } + k.mu.Unlock() if err := k.initializeConns(serviceName); err != nil { + fmt.Println("Failed to initialize connections:", err) return nil, fmt.Errorf("failed to initialize connections for service %s: %v", serviceName, err) } @@ -125,26 +115,64 @@ func (k *KubernetesConnManager) GetConns(ctx context.Context, serviceName string // GetConn returns a single gRPC client connection for a given Kubernetes service name. func (k *KubernetesConnManager) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { - port, err := k.getServicePort(serviceName) - if err != nil { - return nil, err - } + var target string - fmt.Println("SVC port:", port) + if k.rpcTargets[serviceName] == "" { + var err error + + svcPort, err := k.getServicePort(serviceName) + if err != nil { + return nil, err + } - target := fmt.Sprintf("%s.%s.svc.cluster.local:%d", serviceName, k.namespace, port) + target = fmt.Sprintf("%s.%s.svc.cluster.local:%d", serviceName, k.namespace, svcPort) - fmt.Println("SVC target:", target) + // fmt.Println("SVC target:", target) + } else { + target = k.rpcTargets[serviceName] + } return grpc.DialContext( ctx, target, - append([]grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}, k.dialOptions...)..., + append([]grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*10), grpc.MaxCallSendMsgSize(1024*1024*20)), + }, k.dialOptions...)..., ) } // GetSelfConnTarget returns the connection target for the current service. func (k *KubernetesConnManager) GetSelfConnTarget() string { + if k.selfTarget == "" { + hostName := os.Getenv("HOSTNAME") + + pod, err := k.clientset.CoreV1().Pods(k.namespace).Get(context.Background(), hostName, metav1.GetOptions{}) + if err != nil { + log.Printf("failed to get pod %s: %v \n", hostName, err) + } + + for pod.Status.PodIP == "" { + pod, err = k.clientset.CoreV1().Pods(k.namespace).Get(context.TODO(), hostName, metav1.GetOptions{}) + if err != nil { + log.Printf("Error getting pod: %v \n", err) + } + + time.Sleep(3 * time.Second) + } + + var selfPort int32 + + for _, port := range pod.Spec.Containers[0].Ports { + if port.ContainerPort != 10001 { + selfPort = port.ContainerPort + break + } + } + + k.selfTarget = fmt.Sprintf("%s:%d", pod.Status.PodIP, selfPort) + } + return k.selfTarget } @@ -175,6 +203,7 @@ func (k *KubernetesConnManager) Close() { func (k *KubernetesConnManager) Register(serviceName, host string, port int, opts ...grpc.DialOption) error { return nil } + func (k *KubernetesConnManager) UnRegister() error { return nil } @@ -184,6 +213,8 @@ func (k *KubernetesConnManager) GetUserIdHashGatewayHost(ctx context.Context, us } func (k *KubernetesConnManager) getServicePort(serviceName string) (int32, error) { + var svcPort int32 + svc, err := k.clientset.CoreV1().Services(k.namespace).Get(context.Background(), serviceName, metav1.GetOptions{}) if err != nil { fmt.Print("namespace:", k.namespace) @@ -194,7 +225,15 @@ func (k *KubernetesConnManager) getServicePort(serviceName string) (int32, error return 0, fmt.Errorf("service %s has no ports defined", serviceName) } - return svc.Spec.Ports[0].Port, nil + for _, port := range svc.Spec.Ports { + // fmt.Println(serviceName, " Now Get Port:", port.Port) + if port.Port != 10001 { + svcPort = port.Port + break + } + } + + return svcPort, nil } // watchEndpoints listens for changes in Pod resources. @@ -229,68 +268,3 @@ func (k *KubernetesConnManager) handleEndpointChange(obj interface{}) { fmt.Printf("Error initializing connections for %s: %v\n", serviceName, err) } } - -// ================= - -// initEndpoints initializes connections by fetching all available endpoints in the specified namespace. - -// func (k *KubernetesConnManager) initEndpoints() error { -// k.mu.Lock() -// defer k.mu.Unlock() - -// pods, err := k.clientset.CoreV1().Pods(k.namespace).List(context.TODO(), metav1.ListOptions{}) -// if err != nil { -// return fmt.Errorf("failed to list pods: %v", err) -// } - -// for _, pod := range pods.Items { -// if pod.Status.Phase == v1.PodRunning { -// target := fmt.Sprintf("%s:%d", address.IP, port) -// conn, err := grpc.Dial(target, grpc.WithTransportCredentials(insecure.NewCredentials())) -// conn, err := k.createGRPCConnection(pod) -// if err != nil { -// return fmt.Errorf("failed to create GRPC connection for pod %s: %v", pod.Name, err) -// } -// k.connMap[pod.Name] = append(k.connMap[pod.Name], conn) -// } -// } - -// return nil -// } - -// ----- - -// func (k *KubernetesConnManager) watchEndpoints1(serviceName string) { -// // watch for changes to the service's endpoints -// informerFactory := informers.NewSharedInformerFactory(k.clientset, time.Minute) -// endpointsInformer := informerFactory.Core().V1().Endpoints().Informer() - -// endpointsInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ -// AddFunc: func(obj interface{}) { -// eps := obj.(*v1.Endpoints) -// if eps.Name == serviceName { -// k.initializeConns(serviceName) -// } -// }, -// UpdateFunc: func(oldObj, newObj interface{}) { -// eps := newObj.(*v1.Endpoints) -// if eps.Name == serviceName { -// k.initializeConns(serviceName) -// } -// }, -// DeleteFunc: func(obj interface{}) { -// eps := obj.(*v1.Endpoints) -// if eps.Name == serviceName { -// k.mu.Lock() -// defer k.mu.Unlock() -// for _, conn := range k.connMap[serviceName] { -// _ = conn.Close() -// } -// delete(k.connMap, serviceName) -// } -// }, -// }) - -// informerFactory.Start(wait.NeverStop) -// informerFactory.WaitForCacheSync(wait.NeverStop) -// } From 4cd8914bf5f8d4df9f416ef20c935bbc14a91f56 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:18:18 +0800 Subject: [PATCH 26/33] build: improve kubernetes deployment. --- deployments/deploy/clusterRole.yml | 3 +- deployments/deploy/minio-statefulset.yml | 16 +- deployments/deploy/mongo-service.yml | 2 +- deployments/deploy/openim-api-deployment.yml | 20 +- deployments/deploy/openim-api-service.yml | 4 +- deployments/deploy/openim-config.yml | 182 +++++++++--------- .../deploy/openim-crontask-deployment.yml | 1 - .../deploy/openim-msggateway-deployment.yml | 8 +- .../deploy/openim-msggateway-service.yml | 10 +- deployments/deploy/openim-push-deployment.yml | 8 +- deployments/deploy/openim-push-service.yml | 4 +- .../openim-rpc-conversation-deployment.yml | 1 - .../deploy/openim-rpc-third-deployment.yml | 20 +- deployments/deploy/prometheus-config.yml | 112 ----------- 14 files changed, 146 insertions(+), 245 deletions(-) delete mode 100644 deployments/deploy/prometheus-config.yml diff --git a/deployments/deploy/clusterRole.yml b/deployments/deploy/clusterRole.yml index 328cb6c7ea..190c0b2686 100644 --- a/deployments/deploy/clusterRole.yml +++ b/deployments/deploy/clusterRole.yml @@ -2,11 +2,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - # role name name: service-reader rules: - apiGroups: [""] - resources: ["services"] + resources: ["services", "endpoints"] verbs: ["get", "list", "watch"] --- diff --git a/deployments/deploy/minio-statefulset.yml b/deployments/deploy/minio-statefulset.yml index 7985f71f5d..c8806ff12a 100644 --- a/deployments/deploy/minio-statefulset.yml +++ b/deployments/deploy/minio-statefulset.yml @@ -17,7 +17,6 @@ spec: containers: - name: minio image: minio/minio:RELEASE.2024-01-11T07-46-16Z - imagePullPolicy: IfNotPresent ports: - containerPort: 9000 # MinIO service port - containerPort: 9090 # MinIO console port @@ -29,23 +28,22 @@ spec: env: - name: TZ value: "Asia/Shanghai" - - name: MINIO_ACCESS_KEY + - name: MINIO_ROOT_USER valueFrom: secretKeyRef: name: minio-secret key: minio-root-user - - name: MINIO_SECRET_KEY + - name: MINIO_ROOT_PASSWORD valueFrom: secretKeyRef: name: minio-secret key: minio-root-password - command: - - minio - - server - - /data - - "--console-address" - - ":9090" + - "/bin/sh" + - "-c" + - | + mkdir -p /data && \ + minio server /data --console-address ":9090" volumes: - name: minio-data persistentVolumeClaim: diff --git a/deployments/deploy/mongo-service.yml b/deployments/deploy/mongo-service.yml index ea5a85203f..c3b3a10275 100644 --- a/deployments/deploy/mongo-service.yml +++ b/deployments/deploy/mongo-service.yml @@ -10,4 +10,4 @@ spec: protocol: TCP port: 37017 targetPort: 27017 - type: ClusterIP + type: NodePort diff --git a/deployments/deploy/openim-api-deployment.yml b/deployments/deploy/openim-api-deployment.yml index 7dc2f7d082..cb1a68075d 100644 --- a/deployments/deploy/openim-api-deployment.yml +++ b/deployments/deploy/openim-api-deployment.yml @@ -17,7 +17,25 @@ spec: image: openim/openim-api:v3.8.3 env: - name: CONFIG_PATH - value: "/config" + value: "/config" + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password + + - name: IMENV_MONGODB_USERNAME + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_username + volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-api-service.yml b/deployments/deploy/openim-api-service.yml index 468b5721f9..a75bcd34ed 100644 --- a/deployments/deploy/openim-api-service.yml +++ b/deployments/deploy/openim-api-service.yml @@ -6,11 +6,11 @@ spec: selector: app: openim-api ports: - - name: http-10302 + - name: http-10002 protocol: TCP port: 10002 targetPort: 10002 - - name: prometheus-20113 + - name: prometheus-12002 protocol: TCP port: 12002 targetPort: 12002 diff --git a/deployments/deploy/openim-config.yml b/deployments/deploy/openim-config.yml index 679b15c0e8..d0651bdeaa 100644 --- a/deployments/deploy/openim-config.yml +++ b/deployments/deploy/openim-config.yml @@ -14,11 +14,11 @@ data: password: '' rpcService: - messageGateway: messageGateway-rpc-service user: user-rpc-service friend: friend-rpc-service msg: msg-rpc-service push: push-rpc-service + messageGateway: messagegateway-rpc-service group: group-rpc-service auth: auth-rpc-service conversation: conversation-rpc-service @@ -438,9 +438,9 @@ data: # Name of the bucket in MinIO bucket: openim # Access key ID for MinIO authentication - accessKeyID: root # ${MINIO_ACCESS_KEY} + accessKeyID: root # Secret access key for MinIO authentication - secretAccessKey: # openIM123 # ${MINIO_SECRET_KEY} + secretAccessKey: # openIM123 # Session token for MinIO authentication (optional) sessionToken: # Internal address of the MinIO server @@ -775,94 +775,6 @@ data: desc: burn after reading ext: burn after reading - prometheus.yml: | - # my global config - global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. - evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. - # scrape_timeout is set to the global default (10s). - - # Alertmanager configuration - alerting: - alertmanagers: - - static_configs: - - targets: [internal_ip:19093] - - # Load rules once and periodically evaluate them according to the global evaluation_interval. - rule_files: - - instance-down-rules.yml - # - first_rules.yml - # - second_rules.yml - - # A scrape configuration containing exactly one endpoint to scrape: - # Here it's Prometheus itself. - scrape_configs: - # The job name is added as a label "job=job_name" to any timeseries scraped from this config. - # Monitored information captured by prometheus - - # prometheus fetches application services - - job_name: node_exporter - static_configs: - - targets: [ internal_ip:20500 ] - - job_name: openimserver-openim-api - static_configs: - - targets: [ internal_ip:12002 ] - labels: - namespace: default - - job_name: openimserver-openim-msggateway - static_configs: - - targets: [ internal_ip:12140 ] - # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] - labels: - namespace: default - - job_name: openimserver-openim-msgtransfer - static_configs: - - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027 ] - # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] - labels: - namespace: default - - job_name: openimserver-openim-push - static_configs: - - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177 ] - # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-auth - static_configs: - - targets: [ internal_ip:12200 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-conversation - static_configs: - - targets: [ internal_ip:12220 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-friend - static_configs: - - targets: [ internal_ip:12240 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-group - static_configs: - - targets: [ internal_ip:12260 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-msg - static_configs: - - targets: [ internal_ip:12280 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-third - static_configs: - - targets: [ internal_ip:12300 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-user - static_configs: - - targets: [ internal_ip:12320 ] - labels: - namespace: default - webhooks.yml: | url: http://127.0.0.1:10006/callbackExample beforeSendSingleMsg: @@ -1056,6 +968,94 @@ data: enable: false timeout: 5 + prometheus.yml: | + # my global config + global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Alertmanager configuration + alerting: + alertmanagers: + - static_configs: + - targets: [internal_ip:19093] + + # Load rules once and periodically evaluate them according to the global evaluation_interval. + rule_files: + - instance-down-rules.yml + # - first_rules.yml + # - second_rules.yml + + # A scrape configuration containing exactly one endpoint to scrape: + # Here it's Prometheus itself. + scrape_configs: + # The job name is added as a label "job=job_name" to any timeseries scraped from this config. + # Monitored information captured by prometheus + + # prometheus fetches application services + - job_name: node_exporter + static_configs: + - targets: [ internal_ip:20500 ] + - job_name: openimserver-openim-api + static_configs: + - targets: [ internal_ip:12002 ] + labels: + namespace: default + - job_name: openimserver-openim-msggateway + static_configs: + - targets: [ internal_ip:12140 ] + # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] + labels: + namespace: default + - job_name: openimserver-openim-msgtransfer + static_configs: + - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027 ] + # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] + labels: + namespace: default + - job_name: openimserver-openim-push + static_configs: + - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177 ] + # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-auth + static_configs: + - targets: [ internal_ip:12200 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-conversation + static_configs: + - targets: [ internal_ip:12220 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-friend + static_configs: + - targets: [ internal_ip:12240 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-group + static_configs: + - targets: [ internal_ip:12260 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-msg + static_configs: + - targets: [ internal_ip:12280 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-third + static_configs: + - targets: [ internal_ip:12300 ] + labels: + namespace: default + - job_name: openimserver-openim-rpc-user + static_configs: + - targets: [ internal_ip:12320 ] + labels: + namespace: default + --- apiVersion: v1 kind: Secret diff --git a/deployments/deploy/openim-crontask-deployment.yml b/deployments/deploy/openim-crontask-deployment.yml index 207e2168fb..ca62714cd2 100644 --- a/deployments/deploy/openim-crontask-deployment.yml +++ b/deployments/deploy/openim-crontask-deployment.yml @@ -18,7 +18,6 @@ spec: env: - name: CONFIG_PATH value: "/config" - volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/openim-msggateway-deployment.yml b/deployments/deploy/openim-msggateway-deployment.yml index ace1493000..ba2b1b84ea 100644 --- a/deployments/deploy/openim-msggateway-deployment.yml +++ b/deployments/deploy/openim-msggateway-deployment.yml @@ -1,16 +1,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: openim-msggateway-server + name: messagegateway-rpc-server spec: replicas: 2 selector: matchLabels: - app: openim-msggateway-server + app: messagegateway-rpc-server template: metadata: labels: - app: openim-msggateway-server + app: messagegateway-rpc-server spec: containers: - name: openim-msggateway-container @@ -28,7 +28,7 @@ spec: mountPath: "/config" readOnly: true ports: - - containerPort: 10001 + - containerPort: 10140 - containerPort: 12001 volumes: - name: openim-config diff --git a/deployments/deploy/openim-msggateway-service.yml b/deployments/deploy/openim-msggateway-service.yml index 575b182057..8b8ea2f165 100644 --- a/deployments/deploy/openim-msggateway-service.yml +++ b/deployments/deploy/openim-msggateway-service.yml @@ -1,19 +1,19 @@ apiVersion: v1 kind: Service metadata: - name: openim-msggateway-service + name: messagegateway-rpc-service spec: selector: - app: openim-msggateway-server + app: messagegateway-rpc-server ports: - name: longConnServer-10001 protocol: TCP port: 10001 targetPort: 10001 - - name: http-12001 + - name: grpc-10140 protocol: TCP - port: 12001 - targetPort: 12001 + port: 10140 + targetPort: 10140 - name: prometheus-12001 protocol: TCP port: 12001 diff --git a/deployments/deploy/openim-push-deployment.yml b/deployments/deploy/openim-push-deployment.yml index b7a38f0855..2092b343c6 100644 --- a/deployments/deploy/openim-push-deployment.yml +++ b/deployments/deploy/openim-push-deployment.yml @@ -1,19 +1,19 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: openim-push-server + name: push-rpc-server spec: replicas: 2 selector: matchLabels: - app: openim-push-server + app: push-rpc-server template: metadata: labels: - app: openim-push-server + app: push-rpc-server spec: containers: - - name: openim-push-container + - name: push-rpc-server-container image: openim/openim-push:v3.8.3 env: - name: CONFIG_PATH diff --git a/deployments/deploy/openim-push-service.yml b/deployments/deploy/openim-push-service.yml index 237f755f04..33f39c2d6a 100644 --- a/deployments/deploy/openim-push-service.yml +++ b/deployments/deploy/openim-push-service.yml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: openim-push-service + name: push-rpc-service spec: selector: - app: openim-push-server + app: push-rpc-server ports: - name: http-10170 protocol: TCP diff --git a/deployments/deploy/openim-rpc-conversation-deployment.yml b/deployments/deploy/openim-rpc-conversation-deployment.yml index f29977ba3a..4d7a32497f 100644 --- a/deployments/deploy/openim-rpc-conversation-deployment.yml +++ b/deployments/deploy/openim-rpc-conversation-deployment.yml @@ -15,7 +15,6 @@ spec: containers: - name: conversation-rpc-server-container image: openim/openim-rpc-conversation:v3.8.3 - imagePullPolicy: Never env: - name: CONFIG_PATH value: "/config" diff --git a/deployments/deploy/openim-rpc-third-deployment.yml b/deployments/deploy/openim-rpc-third-deployment.yml index 997f032bd0..326aaee035 100644 --- a/deployments/deploy/openim-rpc-third-deployment.yml +++ b/deployments/deploy/openim-rpc-third-deployment.yml @@ -18,16 +18,6 @@ spec: env: - name: CONFIG_PATH value: "/config" - - name: IMENV_REDIS_PASSWORD - valueFrom: - secretKeyRef: - name: redis-secret - key: redis-password - - name: IMENV_MONGODB_PASSWORD - valueFrom: - secretKeyRef: - name: mongo-secret - key: mongo_openim_password - name: IMENV_MINIO_ACCESSKEYID valueFrom: secretKeyRef: @@ -38,6 +28,16 @@ spec: secretKeyRef: name: minio-secret key: minio-root-password + - name: IMENV_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis-secret + key: redis-password + - name: IMENV_MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: mongo-secret + key: mongo_openim_password volumeMounts: - name: openim-config mountPath: "/config" diff --git a/deployments/deploy/prometheus-config.yml b/deployments/deploy/prometheus-config.yml deleted file mode 100644 index 0fc51b1fd5..0000000000 --- a/deployments/deploy/prometheus-config.yml +++ /dev/null @@ -1,112 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: prometheus-config -data: - prometheus.yml: | - # my global config - global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. - evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. - # scrape_timeout is set to the global default (10s). - - # Alertmanager configuration - alerting: - alertmanagers: - - static_configs: - - targets: [internal_ip:19093] - - # Load rules once and periodically evaluate them according to the global evaluation_interval. - rule_files: - - instance-down-rules.yml - # - first_rules.yml - # - second_rules.yml - - # A scrape configuration containing exactly one endpoint to scrape: - # Here it's Prometheus itself. - scrape_configs: - # The job name is added as a label "job=job_name" to any timeseries scraped from this config. - # Monitored information captured by prometheus - - # prometheus fetches application services - - job_name: node_exporter - static_configs: - - targets: [internal_ip:20500] - - job_name: openimserver-openim-api - static_configs: - - targets: [internal_ip:12002] - labels: - namespace: default - - job_name: openimserver-openim-msggateway - static_configs: - - targets: [internal_ip:12140] - # - targets: [ internal_ip:12140, internal_ip:12141, internal_ip:12142, internal_ip:12143, internal_ip:12144, internal_ip:12145, internal_ip:12146, internal_ip:12147, internal_ip:12148, internal_ip:12149, internal_ip:12150, internal_ip:12151, internal_ip:12152, internal_ip:12153, internal_ip:12154, internal_ip:12155 ] - labels: - namespace: default - - job_name: openimserver-openim-msgtransfer - static_configs: - - targets: - [ - internal_ip:12020, - internal_ip:12021, - internal_ip:12022, - internal_ip:12023, - internal_ip:12024, - internal_ip:12025, - internal_ip:12026, - internal_ip:12027, - ] - # - targets: [ internal_ip:12020, internal_ip:12021, internal_ip:12022, internal_ip:12023, internal_ip:12024, internal_ip:12025, internal_ip:12026, internal_ip:12027, internal_ip:12028, internal_ip:12029, internal_ip:12030, internal_ip:12031, internal_ip:12032, internal_ip:12033, internal_ip:12034, internal_ip:12035 ] - labels: - namespace: default - - job_name: openimserver-openim-push - static_configs: - - targets: - [ - internal_ip:12170, - internal_ip:12171, - internal_ip:12172, - internal_ip:12173, - internal_ip:12174, - internal_ip:12175, - internal_ip:12176, - internal_ip:12177, - ] - # - targets: [ internal_ip:12170, internal_ip:12171, internal_ip:12172, internal_ip:12173, internal_ip:12174, internal_ip:12175, internal_ip:12176, internal_ip:12177, internal_ip:12178, internal_ip:12179, internal_ip:12180, internal_ip:12182, internal_ip:12183, internal_ip:12184, internal_ip:12185, internal_ip:12186 ] - labels: - namespace: default - - job_name: openimserver-openim-rpc-auth - static_configs: - - targets: [internal_ip:12200] - labels: - namespace: default - - job_name: openimserver-openim-rpc-conversation - static_configs: - - targets: [internal_ip:12220] - labels: - namespace: default - - job_name: openimserver-openim-rpc-friend - static_configs: - - targets: [internal_ip:12240] - labels: - namespace: default - - job_name: openimserver-openim-rpc-group - static_configs: - - targets: [internal_ip:12260] - labels: - namespace: default - - job_name: openimserver-openim-rpc-msg - static_configs: - - targets: [internal_ip:12280] - labels: - namespace: default - - job_name: openimserver-openim-rpc-third - static_configs: - - targets: [internal_ip:12300] - labels: - namespace: default - - job_name: openimserver-openim-rpc-user - static_configs: - - targets: [internal_ip:12320] - labels: - namespace: default From e7a127b7ac9d702d33682727a4bb6dafd4b53534 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:18:31 +0800 Subject: [PATCH 27/33] update config field in discovery. --- config/discovery.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/discovery.yml b/config/discovery.yml index a04d7e40f8..e8d733e9fc 100644 --- a/config/discovery.yml +++ b/config/discovery.yml @@ -13,7 +13,7 @@ rpcService: friend: friend-rpc-service msg: msg-rpc-service push: push-rpc-service - messageGateway: messageGateway-rpc-service + messageGateway: messagegateway-rpc-service group: group-rpc-service auth: auth-rpc-service conversation: conversation-rpc-service From ea6d1c21af1245c21dc2640c50ed9730fb2029f3 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:33:15 +0800 Subject: [PATCH 28/33] update ReadMe in deployments. --- deployments/Readme.md | 174 +---------------------------------- deployments/deploy/README.md | 22 +++-- 2 files changed, 17 insertions(+), 179 deletions(-) diff --git a/deployments/Readme.md b/deployments/Readme.md index a7b288130d..775baaea0d 100644 --- a/deployments/Readme.md +++ b/deployments/Readme.md @@ -1,175 +1,3 @@ # OpenIM Application Containerization Deployment Guide -OpenIM supports a variety of cluster deployment methods, including but not limited to `helm`, `sealos`, `kustomize` - -Various contributors, as well as previous official releases, have provided some referenceable solutions: - -+ [k8s-jenkins Repository](https://github.com/OpenIMSDK/k8s-jenkins) -+ [open-im-server-k8s-deploy Repository](https://github.com/openimsdk/open-im-server-k8s-deploy) -+ [openim-charts Repository](https://github.com/OpenIMSDK/openim-charts) -+ [deploy-openim Repository](https://github.com/showurl/deploy-openim) - -### Dependency Check - -```bash -Kubernetes: >= 1.16.0-0 -Helm: >= 3.0 -``` - -### Minimum Configuration - -The recommended minimum configuration for a production environment is as follows: - -```yaml -CPU: 4 -Memory: 8G -Disk: 100G -``` - -## Configuration File Generation - -We have automated all the files, making the generation of configuration files optional for OpenIM. However, if you desire custom configurations, you can follow the steps below: - -```bash -$ make init -# Alternatively, use script: -# ./scripts/init-config.sh -``` - -At this point, configuration files will be generated under `deployments/openim/config`, which you can modify as per your requirements. - -## Cluster Setup - -If you already have a `kubernetes` cluster, or if you wish to build a `kubernetes` cluster from scratch, you can skip this step. - -For a quick start, I used [sealos](https://github.com/labring/sealos) to rapidly set up the cluster, with sealos also being a wrapper for kubeadm at its core: - -```bash -$ SEALOS_VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` && \ - curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh | - sh -s ${SEALOS_VERSION} labring/sealos -``` - -**Supported Versions:** - -+ docker: `labring/kubernetes-docker`:(v1.24.0~v1.27.0) -+ containerd: `labring/kubernetes`:(v1.24.0~v1.27.0) - -#### Cluster Installation: - -Cluster details are as follows: - -| Hostname | IP Address | System Info | -| -------- | ---------- | ------------------------------------------------------------ | -| master01 | 10.0.0.9 | `Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux` | -| node01 | 10.0.0.4 | Similar to master01 | -| node02 | 10.0.0.10 | Similar to master01 | - -```bash -$ export CLUSTER_USERNAME=ubuntu -$ export CLUSTER_PASSWORD=123456 -$ sudo sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ - --masters 10.0.0.9 \ - --nodes 10.0.0.4,10.0.0.10 \ - -u "$CLUSTER_USERNAME" \ - -p "$CLUSTER_PASSWORD" -``` - -> **Node** Uninstallation method: using `kubeadm` for uninstallation does not remove `etcd` and `cni` related configurations. Manual clearance or using `sealos` for uninstallation is needed. -> -> ```bash -> $ sealos reset -> ``` - -If you are local, you can also use Kind and Minikube to test, for example, using Kind: - -```bash -$ GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.1 -$ kind create cluster -``` - -### Installing helm - -Helm simplifies the deployment and management of Kubernetes applications to a large extent by offering version control and release management through packaging. - -**Using Script:** - -```bash -$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash -``` - -**Adding Repository:** - -```bash -$ helm repo add brigade https://openimsdk.github.io/openim-charts -``` - -### OpenIM Image Strategy - -Automated offerings include aliyun, ghcr, docker hub: [Image Documentation](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/images.md) - -**Local Test Build Method:** - -```bash -$ make image -``` - -> This command assists in quickly building the required images locally. For a detailed build strategy, refer to the [Build Documentation](https://github.com/openimsdk/open-im-server/blob/main/build/README.md). - -## Installation - -Explore our Helm-Charts repository and read through: [Helm-Charts Repository](https://github.com/openimsdk/helm-charts) - - -Using the helm charts repository, you can ignore the following configuration, but if you want to just use the server and scale on top of it, you can go ahead: - -**Use the Helm template to generate the deployment yaml file: `openim-charts.yaml`** - -**Gen Image:** - -```bash -../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/helm-image.yaml > ./charts/generated-configs/helm-image.yaml -``` - -**Gen Charts:** - -```bash -for chart in ./charts/*/; do - if [[ "$chart" == *"generated-configs"* || "$chart" == *"helmfile.yaml"* ]]; then - continue - fi - - if [ -f "${chart}values.yaml" ]; then - helm template "$chart" -f "./charts/generated-configs/helm-image.yaml" -f "./charts/generated-configs/config.yaml" -f "./charts/generated-configs/notification.yaml" >> openim-charts.yaml - else - helm template "$chart" >> openim-charts.yaml - fi -done -``` - -**Use Helmfile:** - -```bash -GO111MODULE=on go get github.com/roboll/helmfile@latest -``` - -```bash -export MONGO_ADDRESS=im-mongo -export MONGO_PORT=27017 -export REDIS_ADDRESS=im-redis-master -export REDIS_PORT=6379 -export KAFKA_ADDRESS=im-kafka -export KAFKA_PORT=9092 -export OBJECT_APIURL="https://openim.server.com/api" -export MINIO_ENDPOINT="http://im-minio:9000" -export MINIO_SIGN_ENDPOINT="https://openim.server.com/im-minio-api" - -mkdir ./charts/generated-configs -../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/config.yaml > ./charts/generated-configs/config.yaml -cp ../config/notification.yaml ./charts/generated-configs/notification.yaml -../scripts/genconfig.sh ../scripts/install/environment.sh ./templates/helm-image.yaml > ./charts/generated-configs/helm-image.yaml -``` - -```bash -helmfile apply -``` +view deploy [README](./deploy/README.md) \ No newline at end of file diff --git a/deployments/deploy/README.md b/deployments/deploy/README.md index 0fa8697c86..d6b083bc55 100644 --- a/deployments/deploy/README.md +++ b/deployments/deploy/README.md @@ -1,25 +1,34 @@ # Kubernetes Deployment ## Resource Requests + - CPU: 2 cores - Memory: 4 GiB - Disk usage: 20 GiB (on Node) ## Origin Deploy + 1. Enter the target dir -`cd ./deployments/deploy/` + `cd ./deployments/deploy/` 2. Deploy configs and dependencies + Upate your `openim-config.yml` Apply all config and dependencies -`kubectl apply -f ./openim-config.yml -f ` +`kubectl apply -f ./openim-config.yml` + +> Attation: If you use `default` namespace, you can excute `clusterRile.yml` to create a cluster role binding for default service account. +> +> Namespace is modify to `discovery.yml` in `openim-config.yml`, you can change `kubernetes.namespace` to your namespace. + +Excute `clusterRole.yml` +`kubectl apply -f ./clusterRole.yml` Run infrasturcture components. `kubectl apply -f minio-service.yml -f minio-statefulset.yml -f mongo-service.yml -f mongo-statefulset.yml -f redis-service.yml -f redis-statefulset.yml -f kafka-service.yml -f kafka-statefulset.yml` ->Note: Ensure that infrastructure services like MinIO, Redis, and Kafka are running before deploying the main applications. - +> Note: Ensure that infrastructure services like MinIO, Redis, and Kafka are running before deploying the main applications. 3. run all deployments and services @@ -51,7 +60,7 @@ kubectl apply \ ``` 4. Verification -After deploying the services, verify that everything is running smoothly: + After deploying the services, verify that everything is running smoothly: ```bash # Check the status of all pods @@ -72,4 +81,5 @@ kubectl get all `kubectl delete -f ./` ### Notes: -- If you use a specific namespace for your deployment, be sure to append the -n flag to your kubectl commands. \ No newline at end of file + +- If you use a specific namespace for your deployment, be sure to append the -n flag to your kubectl commands. From 248dc2df7cdb2a4df0830c8acd65deaaca52cfb2 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:36:49 +0800 Subject: [PATCH 29/33] update go mod. --- go.sum | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/go.sum b/go.sum index dd61defdc1..3d25082ea9 100644 --- a/go.sum +++ b/go.sum @@ -347,22 +347,10 @@ github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/openimsdk/gomake v0.0.15-alpha.2 h1:5Q8yl8ezy2yx+q8/ucU/t4kJnDfCzNOrkXcDACCqtyM= github.com/openimsdk/gomake v0.0.15-alpha.2/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= -<<<<<<< HEAD -github.com/openimsdk/protocol v0.0.72-alpha.61 h1:RuZR9/Sg3p6Bpb2CKPjPoA2AUmTvHITmhZ3PT/RbWMs= -github.com/openimsdk/protocol v0.0.72-alpha.61/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M= -github.com/openimsdk/tools v0.0.50-alpha.51 h1:M3dMUoHjggx5Ry6XSkK0FTSJmRQjjkSBpuzXiFzKtC4= -github.com/openimsdk/tools v0.0.50-alpha.51/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= -||||||| 54be83776 -github.com/openimsdk/protocol v0.0.72-alpha.61 h1:RuZR9/Sg3p6Bpb2CKPjPoA2AUmTvHITmhZ3PT/RbWMs= -github.com/openimsdk/protocol v0.0.72-alpha.61/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M= -github.com/openimsdk/tools v0.0.50-alpha.46 h1:j3HxPxhDptVHwr7eChL2rCH8mKfpUEcr4nHi5k4yDME= -github.com/openimsdk/tools v0.0.50-alpha.46/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= -======= github.com/openimsdk/protocol v0.0.72-alpha.63 h1:IyPBibEvwBtTmD8DSrlqcekfEXe74k4+KeeHsgdhGh0= github.com/openimsdk/protocol v0.0.72-alpha.63/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M= -github.com/openimsdk/tools v0.0.50-alpha.50 h1:+naDlvHcqJDj2NsCGnQd1LLQOET5IRPbrtmWbM/o7JQ= -github.com/openimsdk/tools v0.0.50-alpha.50/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= ->>>>>>> 0435915df1702611864caf224139a577ce4df9d0 +github.com/openimsdk/tools v0.0.50-alpha.51 h1:M3dMUoHjggx5Ry6XSkK0FTSJmRQjjkSBpuzXiFzKtC4= +github.com/openimsdk/tools v0.0.50-alpha.51/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= From 2923b625eb366b917329a10a9146f52760e793f5 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 16:45:45 +0800 Subject: [PATCH 30/33] update const quote. --- internal/api/init.go | 10 +++++----- internal/api/prometheus_discovery.go | 9 +++++---- internal/msgtransfer/init.go | 18 +++++++++--------- pkg/common/startrpc/start.go | 8 ++++---- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/internal/api/init.go b/internal/api/init.go index 8fb6baff5b..59b19ee894 100644 --- a/internal/api/init.go +++ b/internal/api/init.go @@ -26,7 +26,7 @@ import ( "syscall" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" + conf "github.com/openimsdk/open-im-server/v3/pkg/common/config" kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/tools/discovery" @@ -41,9 +41,9 @@ import ( ) type Config struct { - API config.API - Share config.Share - Discovery config.Discovery + API conf.API + Share conf.Share + Discovery conf.Discovery RuntimeEnv string } @@ -86,7 +86,7 @@ func Start(ctx context.Context, index int, config *Config) error { return listener, port, nil } - if config.API.Prometheus.AutoSetPorts && config.Discovery.Enable != kdisc.Etcd { + if config.API.Prometheus.AutoSetPorts && config.Discovery.Enable != conf.ETCD { return errs.New("only etcd support autoSetPorts", "RegisterName", "api").Wrap() } diff --git a/internal/api/prometheus_discovery.go b/internal/api/prometheus_discovery.go index 6e33274be9..5e1a9cae29 100644 --- a/internal/api/prometheus_discovery.go +++ b/internal/api/prometheus_discovery.go @@ -2,8 +2,10 @@ package api import ( "encoding/json" + "net/http" + "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" + conf "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/tools/apiresp" "github.com/openimsdk/tools/discovery" @@ -11,7 +13,6 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" clientv3 "go.etcd.io/etcd/client/v3" - "net/http" ) type PrometheusDiscoveryApi struct { @@ -23,14 +24,14 @@ func NewPrometheusDiscoveryApi(config *Config, client discovery.SvcDiscoveryRegi api := &PrometheusDiscoveryApi{ config: config, } - if config.Discovery.Enable == discoveryregister.Etcd { + if config.Discovery.Enable == conf.ETCD { api.client = client.(*etcd.SvcDiscoveryRegistryImpl).GetClient() } return api } func (p *PrometheusDiscoveryApi) Enable(c *gin.Context) { - if p.config.Discovery.Enable != discoveryregister.Etcd { + if p.config.Discovery.Enable != conf.ETCD { c.JSON(http.StatusOK, []struct{}{}) c.Abort() } diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index 5be5e107da..4c09bc4e2a 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -37,7 +37,7 @@ import ( "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/runtimeenv" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" + conf "github.com/openimsdk/open-im-server/v3/pkg/common/config" discRegister "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" @@ -64,13 +64,13 @@ type MsgTransfer struct { } type Config struct { - MsgTransfer config.MsgTransfer - RedisConfig config.Redis - MongodbConfig config.Mongo - KafkaConfig config.Kafka - Share config.Share - WebhooksConfig config.Webhooks - Discovery config.Discovery + MsgTransfer conf.MsgTransfer + RedisConfig conf.Redis + MongodbConfig conf.Mongo + KafkaConfig conf.Kafka + Share conf.Share + WebhooksConfig conf.Webhooks + Discovery conf.Discovery } func Start(ctx context.Context, index int, config *Config) error { @@ -168,7 +168,7 @@ func (m *MsgTransfer) Start(index int, config *Config) error { return listener, port, nil } - if config.MsgTransfer.Prometheus.AutoSetPorts && config.Discovery.Enable != kdisc.Etcd { + if config.MsgTransfer.Prometheus.AutoSetPorts && config.Discovery.Enable != conf.ETCD { return errs.New("only etcd support autoSetPorts", "RegisterName", "api").Wrap() } diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go index f75a505415..259f4caed4 100644 --- a/pkg/common/startrpc/start.go +++ b/pkg/common/startrpc/start.go @@ -26,7 +26,7 @@ import ( "syscall" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" + conf "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/tools/discovery/etcd" "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/jsonutil" @@ -46,8 +46,8 @@ import ( ) // Start rpc server. -func Start[T any](ctx context.Context, discovery *config.Discovery, prometheusConfig *config.Prometheus, listenIP, - registerIP string, autoSetPorts bool, rpcPorts []int, index int, rpcRegisterName string, share *config.Share, config T, rpcFn func(ctx context.Context, +func Start[T any](ctx context.Context, discovery *conf.Discovery, prometheusConfig *conf.Prometheus, listenIP, + registerIP string, autoSetPorts bool, rpcPorts []int, index int, rpcRegisterName string, share *conf.Share, config T, rpcFn func(ctx context.Context, config T, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error { var ( @@ -84,7 +84,7 @@ func Start[T any](ctx context.Context, discovery *config.Discovery, prometheusCo return listener, port, nil } - if autoSetPorts && discovery.Enable != kdisc.Etcd { + if autoSetPorts && discovery.Enable != conf.ETCD { return errs.New("only etcd support autoSetPorts", "rpcRegisterName", rpcRegisterName).Wrap() } client, err := kdisc.NewDiscoveryRegister(discovery, runTimeEnv) From 744b3e9e6ecb5e6cd565acfe490767d489ebd6e5 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 17:54:49 +0800 Subject: [PATCH 31/33] fix test fields. --- pkg/common/config/load_config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go index 1552c77d23..e575b27a9d 100644 --- a/pkg/common/config/load_config_test.go +++ b/pkg/common/config/load_config_test.go @@ -86,7 +86,7 @@ func TestLoadOpenIMThirdConfig(t *testing.T) { func TestTransferConfig(t *testing.T) { var tran MsgTransfer - err := LoadConfig("../../../config/openim-msgtransfer.yml", "IMENV_OPENIM-MSGTRANSFER", &tran) + err := Load("../../../config/openim-msgtransfer.yml", "IMENV_OPENIM-MSGTRANSFER", "", "source", &tran) assert.Nil(t, err) assert.Equal(t, true, tran.Prometheus.Enable) assert.Equal(t, true, tran.Prometheus.AutoSetPorts) From a8c11c557c62e36c12c776e41b8fa62ad440f7a2 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 18:05:31 +0800 Subject: [PATCH 32/33] remove unused method. --- pkg/common/config/load_config.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkg/common/config/load_config.go b/pkg/common/config/load_config.go index 28330cfcb6..aa87211f9b 100644 --- a/pkg/common/config/load_config.go +++ b/pkg/common/config/load_config.go @@ -41,23 +41,3 @@ func loadConfig(path string, envPrefix string, config any) error { } return nil } - -func loadConfigK8s(mountPath string, envPrefix string, config any) error { - // configFilePath := filepath.Join(mountPath, configFileName) - v := viper.New() - v.SetConfigFile(mountPath) - v.SetEnvPrefix(envPrefix) - v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - - if err := v.ReadInConfig(); err != nil { - return errs.WrapMsg(err, "failed to read config file", "path", mountPath, "envPrefix", envPrefix) - } - - if err := v.Unmarshal(config, func(config *mapstructure.DecoderConfig) { - config.TagName = "mapstructure" - }); err != nil { - return errs.WrapMsg(err, "failed to unmarshal config", "path", mountPath, "envPrefix", envPrefix) - } - return nil -} From c719c69b83d84caf869803bcc685aa264a9773df Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 12 Dec 2024 18:14:34 +0800 Subject: [PATCH 33/33] remove unused contents. --- deployments/charts/helmfile.yaml | 34 -- deployments/charts/openim-api/.helmignore | 23 - deployments/charts/openim-api/Chart.yaml | 53 -- deployments/charts/openim-api/LICENSE | 201 ------ .../charts/openim-api/templates/NOTES.txt | 22 - .../charts/openim-api/templates/_helpers.tpl | 62 -- .../charts/openim-api/templates/app-cm.yaml | 27 - .../openim-api/templates/deployment.yaml | 86 --- .../charts/openim-api/templates/hpa.yaml | 42 -- .../charts/openim-api/templates/ingress.yaml | 75 --- .../charts/openim-api/templates/service.yaml | 29 - .../openim-api/templates/serviceaccount.yaml | 26 - deployments/charts/openim-api/values.yaml | 100 --- .../charts/openim-msggateway/.helmignore | 23 - .../charts/openim-msggateway/Chart.yaml | 53 -- .../openim-msggateway/templates/NOTES.txt | 22 - .../openim-msggateway/templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 89 --- .../openim-msggateway/templates/hpa.yaml | 42 -- .../openim-msggateway/templates/ingress.yaml | 75 --- .../openim-msggateway/templates/service.yaml | 33 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-msggateway/values.yaml | 96 --- .../charts/openim-msgtransfer/.helmignore | 23 - .../charts/openim-msgtransfer/Chart.yaml | 53 -- .../openim-msgtransfer/templates/NOTES.txt | 22 - .../openim-msgtransfer/templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 86 --- .../openim-msgtransfer/templates/hpa.yaml | 42 -- .../openim-msgtransfer/templates/ingress.yaml | 75 --- .../openim-msgtransfer/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-msgtransfer/values.yaml | 96 --- deployments/charts/openim-push/.helmignore | 23 - deployments/charts/openim-push/Chart.yaml | 53 -- .../charts/openim-push/templates/NOTES.txt | 22 - .../charts/openim-push/templates/_helpers.tpl | 62 -- .../openim-push/templates/deployment.yaml | 86 --- .../charts/openim-push/templates/hpa.yaml | 42 -- .../charts/openim-push/templates/ingress.yaml | 75 --- .../charts/openim-push/templates/service.yaml | 29 - .../openim-push/templates/serviceaccount.yaml | 26 - deployments/charts/openim-push/values.yaml | 96 --- .../charts/openim-rpc-auth/.helmignore | 23 - deployments/charts/openim-rpc-auth/Chart.yaml | 53 -- .../openim-rpc-auth/templates/NOTES.txt | 22 - .../openim-rpc-auth/templates/_helpers.tpl | 62 -- .../openim-rpc-auth/templates/deployment.yaml | 86 --- .../charts/openim-rpc-auth/templates/hpa.yaml | 42 -- .../openim-rpc-auth/templates/ingress.yaml | 75 --- .../openim-rpc-auth/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-rpc-auth/values.yaml | 96 --- .../openim-rpc-conversation/.helmignore | 23 - .../charts/openim-rpc-conversation/Chart.yaml | 53 -- .../templates/NOTES.txt | 22 - .../templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 86 --- .../templates/hpa.yaml | 42 -- .../templates/ingress.yaml | 75 --- .../templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../openim-rpc-conversation/values.yaml | 96 --- .../charts/openim-rpc-friend/.helmignore | 23 - .../charts/openim-rpc-friend/Chart.yaml | 53 -- .../openim-rpc-friend/templates/NOTES.txt | 22 - .../openim-rpc-friend/templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 86 --- .../openim-rpc-friend/templates/hpa.yaml | 42 -- .../openim-rpc-friend/templates/ingress.yaml | 75 --- .../openim-rpc-friend/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-rpc-friend/values.yaml | 96 --- .../charts/openim-rpc-group/.helmignore | 23 - .../charts/openim-rpc-group/Chart.yaml | 53 -- .../openim-rpc-group/templates/NOTES.txt | 22 - .../openim-rpc-group/templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 86 --- .../openim-rpc-group/templates/hpa.yaml | 42 -- .../openim-rpc-group/templates/ingress.yaml | 75 --- .../openim-rpc-group/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-rpc-group/values.yaml | 96 --- deployments/charts/openim-rpc-msg/.helmignore | 23 - deployments/charts/openim-rpc-msg/Chart.yaml | 53 -- .../charts/openim-rpc-msg/templates/NOTES.txt | 22 - .../openim-rpc-msg/templates/_helpers.tpl | 62 -- .../openim-rpc-msg/templates/deployment.yaml | 86 --- .../charts/openim-rpc-msg/templates/hpa.yaml | 42 -- .../openim-rpc-msg/templates/ingress.yaml | 75 --- .../openim-rpc-msg/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - deployments/charts/openim-rpc-msg/values.yaml | 96 --- .../charts/openim-rpc-third/.helmignore | 23 - .../charts/openim-rpc-third/Chart.yaml | 53 -- .../openim-rpc-third/templates/NOTES.txt | 22 - .../openim-rpc-third/templates/_helpers.tpl | 62 -- .../templates/deployment.yaml | 86 --- .../openim-rpc-third/templates/hpa.yaml | 42 -- .../openim-rpc-third/templates/ingress.yaml | 75 --- .../openim-rpc-third/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-rpc-third/values.yaml | 96 --- .../charts/openim-rpc-user/.helmignore | 23 - deployments/charts/openim-rpc-user/Chart.yaml | 53 -- .../openim-rpc-user/templates/NOTES.txt | 22 - .../openim-rpc-user/templates/_helpers.tpl | 62 -- .../openim-rpc-user/templates/deployment.yaml | 86 --- .../charts/openim-rpc-user/templates/hpa.yaml | 42 -- .../openim-rpc-user/templates/ingress.yaml | 75 --- .../openim-rpc-user/templates/service.yaml | 29 - .../templates/serviceaccount.yaml | 26 - .../charts/openim-rpc-user/values.yaml | 96 --- deployments/templates/alertmanager.yml | 47 -- deployments/templates/charts-value.yaml | 110 ---- deployments/templates/config.yaml | 573 ------------------ deployments/templates/email.tmpl | 16 - deployments/templates/env-template.yaml | 237 -------- deployments/templates/helm-image.yaml | 103 ---- deployments/templates/instance-down-rules.yml | 36 -- deployments/templates/notification.yaml | 354 ----------- deployments/templates/openim-api.yaml | 17 - deployments/templates/openim.service | 13 - deployments/templates/openim.target | 7 - deployments/templates/prometheus.yml | 99 --- 125 files changed, 7539 deletions(-) delete mode 100644 deployments/charts/helmfile.yaml delete mode 100644 deployments/charts/openim-api/.helmignore delete mode 100644 deployments/charts/openim-api/Chart.yaml delete mode 100644 deployments/charts/openim-api/LICENSE delete mode 100644 deployments/charts/openim-api/templates/NOTES.txt delete mode 100644 deployments/charts/openim-api/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-api/templates/app-cm.yaml delete mode 100644 deployments/charts/openim-api/templates/deployment.yaml delete mode 100644 deployments/charts/openim-api/templates/hpa.yaml delete mode 100644 deployments/charts/openim-api/templates/ingress.yaml delete mode 100644 deployments/charts/openim-api/templates/service.yaml delete mode 100644 deployments/charts/openim-api/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-api/values.yaml delete mode 100644 deployments/charts/openim-msggateway/.helmignore delete mode 100644 deployments/charts/openim-msggateway/Chart.yaml delete mode 100644 deployments/charts/openim-msggateway/templates/NOTES.txt delete mode 100644 deployments/charts/openim-msggateway/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-msggateway/templates/deployment.yaml delete mode 100644 deployments/charts/openim-msggateway/templates/hpa.yaml delete mode 100644 deployments/charts/openim-msggateway/templates/ingress.yaml delete mode 100644 deployments/charts/openim-msggateway/templates/service.yaml delete mode 100644 deployments/charts/openim-msggateway/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-msggateway/values.yaml delete mode 100644 deployments/charts/openim-msgtransfer/.helmignore delete mode 100644 deployments/charts/openim-msgtransfer/Chart.yaml delete mode 100644 deployments/charts/openim-msgtransfer/templates/NOTES.txt delete mode 100644 deployments/charts/openim-msgtransfer/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-msgtransfer/templates/deployment.yaml delete mode 100644 deployments/charts/openim-msgtransfer/templates/hpa.yaml delete mode 100644 deployments/charts/openim-msgtransfer/templates/ingress.yaml delete mode 100644 deployments/charts/openim-msgtransfer/templates/service.yaml delete mode 100644 deployments/charts/openim-msgtransfer/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-msgtransfer/values.yaml delete mode 100644 deployments/charts/openim-push/.helmignore delete mode 100644 deployments/charts/openim-push/Chart.yaml delete mode 100644 deployments/charts/openim-push/templates/NOTES.txt delete mode 100644 deployments/charts/openim-push/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-push/templates/deployment.yaml delete mode 100644 deployments/charts/openim-push/templates/hpa.yaml delete mode 100644 deployments/charts/openim-push/templates/ingress.yaml delete mode 100644 deployments/charts/openim-push/templates/service.yaml delete mode 100644 deployments/charts/openim-push/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-push/values.yaml delete mode 100644 deployments/charts/openim-rpc-auth/.helmignore delete mode 100644 deployments/charts/openim-rpc-auth/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-auth/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-auth/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-auth/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-auth/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-auth/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-auth/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-auth/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-auth/values.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/.helmignore delete mode 100644 deployments/charts/openim-rpc-conversation/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-conversation/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-conversation/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-conversation/values.yaml delete mode 100644 deployments/charts/openim-rpc-friend/.helmignore delete mode 100644 deployments/charts/openim-rpc-friend/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-friend/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-friend/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-friend/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-friend/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-friend/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-friend/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-friend/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-friend/values.yaml delete mode 100644 deployments/charts/openim-rpc-group/.helmignore delete mode 100644 deployments/charts/openim-rpc-group/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-group/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-group/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-group/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-group/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-group/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-group/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-group/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-group/values.yaml delete mode 100644 deployments/charts/openim-rpc-msg/.helmignore delete mode 100644 deployments/charts/openim-rpc-msg/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-msg/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-msg/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-msg/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-msg/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-msg/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-msg/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-msg/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-msg/values.yaml delete mode 100644 deployments/charts/openim-rpc-third/.helmignore delete mode 100644 deployments/charts/openim-rpc-third/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-third/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-third/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-third/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-third/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-third/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-third/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-third/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-third/values.yaml delete mode 100644 deployments/charts/openim-rpc-user/.helmignore delete mode 100644 deployments/charts/openim-rpc-user/Chart.yaml delete mode 100644 deployments/charts/openim-rpc-user/templates/NOTES.txt delete mode 100644 deployments/charts/openim-rpc-user/templates/_helpers.tpl delete mode 100644 deployments/charts/openim-rpc-user/templates/deployment.yaml delete mode 100644 deployments/charts/openim-rpc-user/templates/hpa.yaml delete mode 100644 deployments/charts/openim-rpc-user/templates/ingress.yaml delete mode 100644 deployments/charts/openim-rpc-user/templates/service.yaml delete mode 100644 deployments/charts/openim-rpc-user/templates/serviceaccount.yaml delete mode 100644 deployments/charts/openim-rpc-user/values.yaml delete mode 100644 deployments/templates/alertmanager.yml delete mode 100644 deployments/templates/charts-value.yaml delete mode 100644 deployments/templates/config.yaml delete mode 100644 deployments/templates/email.tmpl delete mode 100644 deployments/templates/env-template.yaml delete mode 100644 deployments/templates/helm-image.yaml delete mode 100644 deployments/templates/instance-down-rules.yml delete mode 100644 deployments/templates/notification.yaml delete mode 100644 deployments/templates/openim-api.yaml delete mode 100644 deployments/templates/openim.service delete mode 100644 deployments/templates/openim.target delete mode 100644 deployments/templates/prometheus.yml diff --git a/deployments/charts/helmfile.yaml b/deployments/charts/helmfile.yaml deleted file mode 100644 index eb064be9a3..0000000000 --- a/deployments/charts/helmfile.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- define "defaultValues" -}} -- ./generated-configs/helm-image.yaml -- ./generated-configs/config.yaml -- ./generated-configs/notification.yaml -{{- end -}} - -{{- define "defaultRelease" -}} -namespace: openim -chart: ./{{ .name }} -values: - - ./{{ .name }}/values.yaml - {{- template "defaultValues" . }} -{{- end -}} - -releases: -{{- $apps := list "openim-api" "openim-msggateway" "openim-msgtransfer" "openim-push" "openim-rpc-auth" "openim-rpc-conversation" "openim-rpc-friend" "openim-rpc-group" "openim-rpc-msg" "openim-rpc-third" "openim-rpc-user" }} -{{- range $app := $apps }} - - name: {{ $app }} - {{- template "defaultRelease" dict "name" $app }} -{{- end }} diff --git a/deployments/charts/openim-api/.helmignore b/deployments/charts/openim-api/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-api/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-api/Chart.yaml b/deployments/charts/openim-api/Chart.yaml deleted file mode 100644 index e79d2a2c23..0000000000 --- a/deployments/charts/openim-api/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-api -description: A OpenIM Api Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-api/LICENSE b/deployments/charts/openim-api/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/deployments/charts/openim-api/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/deployments/charts/openim-api/templates/NOTES.txt b/deployments/charts/openim-api/templates/NOTES.txt deleted file mode 100644 index e9ce81bdb6..0000000000 --- a/deployments/charts/openim-api/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-api.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-api.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-api.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-api/templates/_helpers.tpl b/deployments/charts/openim-api/templates/_helpers.tpl deleted file mode 100644 index f137492f12..0000000000 --- a/deployments/charts/openim-api/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-api.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-api.labels" -}} -helm.sh/chart: {{ include "openim-api.chart" . }} -{{ include "openim-api.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-api.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-api.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-api.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-api.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-api/templates/app-cm.yaml b/deployments/charts/openim-api/templates/app-cm.yaml deleted file mode 100644 index 9d4e96e8bc..0000000000 --- a/deployments/charts/openim-api/templates/app-cm.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: ConfigMap -metadata: - name: openim-cm -data: - config.yaml: |+ - {{- with .Values.config }} - {{- toYaml . | nindent 4 }} - {{- end }} - notification.yaml: |+ - {{- with .Values.notification }} - {{- toYaml . | nindent 4 }} - {{- end }} diff --git a/deployments/charts/openim-api/templates/deployment.yaml b/deployments/charts/openim-api/templates/deployment.yaml deleted file mode 100644 index b0076393f1..0000000000 --- a/deployments/charts/openim-api/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-api.fullname" . }} - labels: - {{- include "openim-api.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-api.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-api.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-api.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-api/templates/hpa.yaml b/deployments/charts/openim-api/templates/hpa.yaml deleted file mode 100644 index dc0742a255..0000000000 --- a/deployments/charts/openim-api/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-api.fullname" . }} - labels: - {{- include "openim-api.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-api.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-api/templates/ingress.yaml b/deployments/charts/openim-api/templates/ingress.yaml deleted file mode 100644 index 55bc697104..0000000000 --- a/deployments/charts/openim-api/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-api.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-api.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-api/templates/service.yaml b/deployments/charts/openim-api/templates/service.yaml deleted file mode 100644 index 74f75a25e0..0000000000 --- a/deployments/charts/openim-api/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-api.fullname" . }} - labels: - {{- include "openim-api.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-api.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-api/templates/serviceaccount.yaml b/deployments/charts/openim-api/templates/serviceaccount.yaml deleted file mode 100644 index 556a71e345..0000000000 --- a/deployments/charts/openim-api/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-api.serviceAccountName" . }} - labels: - {{- include "openim-api.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-api/values.yaml b/deployments/charts/openim-api/values.yaml deleted file mode 100644 index 4208335de7..0000000000 --- a/deployments/charts/openim-api/values.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-api. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-api - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "nginx" - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -notification: - -config: diff --git a/deployments/charts/openim-msggateway/.helmignore b/deployments/charts/openim-msggateway/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-msggateway/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-msggateway/Chart.yaml b/deployments/charts/openim-msggateway/Chart.yaml deleted file mode 100644 index fb6d0d1538..0000000000 --- a/deployments/charts/openim-msggateway/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-msggateway -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-msggateway/templates/NOTES.txt b/deployments/charts/openim-msggateway/templates/NOTES.txt deleted file mode 100644 index c1f032586f..0000000000 --- a/deployments/charts/openim-msggateway/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msggateway.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msggateway.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msggateway.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msggateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-msggateway/templates/_helpers.tpl b/deployments/charts/openim-msggateway/templates/_helpers.tpl deleted file mode 100644 index c902a1b300..0000000000 --- a/deployments/charts/openim-msggateway/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-msggateway.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-msggateway.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-msggateway.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-msggateway.labels" -}} -helm.sh/chart: {{ include "openim-msggateway.chart" . }} -{{ include "openim-msggateway.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-msggateway.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-msggateway.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-msggateway.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-msggateway.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-msggateway/templates/deployment.yaml b/deployments/charts/openim-msggateway/templates/deployment.yaml deleted file mode 100644 index e938fa9bf4..0000000000 --- a/deployments/charts/openim-msggateway/templates/deployment.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-msggateway.fullname" . }} - labels: - {{- include "openim-msggateway.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-msggateway.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-msggateway.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-msggateway.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - - name: rpc - containerPort: 88 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-msggateway/templates/hpa.yaml b/deployments/charts/openim-msggateway/templates/hpa.yaml deleted file mode 100644 index 99121afbae..0000000000 --- a/deployments/charts/openim-msggateway/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-msggateway.fullname" . }} - labels: - {{- include "openim-msggateway.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-msggateway.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msggateway/templates/ingress.yaml b/deployments/charts/openim-msggateway/templates/ingress.yaml deleted file mode 100644 index 0e22e1936b..0000000000 --- a/deployments/charts/openim-msggateway/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-msggateway.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-msggateway.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msggateway/templates/service.yaml b/deployments/charts/openim-msggateway/templates/service.yaml deleted file mode 100644 index e914ee1d47..0000000000 --- a/deployments/charts/openim-msggateway/templates/service.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-msggateway.fullname" . }} - labels: - {{- include "openim-msggateway.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - - port: 88 - targetPort: rpc - protocol: TCP - name: rpc - selector: - {{- include "openim-msggateway.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-msggateway/templates/serviceaccount.yaml b/deployments/charts/openim-msggateway/templates/serviceaccount.yaml deleted file mode 100644 index 718880d719..0000000000 --- a/deployments/charts/openim-msggateway/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-msggateway.serviceAccountName" . }} - labels: - {{- include "openim-msggateway.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msggateway/values.yaml b/deployments/charts/openim-msggateway/values.yaml deleted file mode 100644 index 059601807f..0000000000 --- a/deployments/charts/openim-msggateway/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-msggateway. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-msggateway - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "nginx" - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-msgtransfer/.helmignore b/deployments/charts/openim-msgtransfer/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-msgtransfer/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-msgtransfer/Chart.yaml b/deployments/charts/openim-msgtransfer/Chart.yaml deleted file mode 100644 index 37d8977281..0000000000 --- a/deployments/charts/openim-msgtransfer/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-msgtransfer -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-msgtransfer/templates/NOTES.txt b/deployments/charts/openim-msgtransfer/templates/NOTES.txt deleted file mode 100644 index a9876065d7..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-msgtransfer.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-msgtransfer.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-msgtransfer.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-msgtransfer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-msgtransfer/templates/_helpers.tpl b/deployments/charts/openim-msgtransfer/templates/_helpers.tpl deleted file mode 100644 index 39f7a9acf1..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-msgtransfer.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-msgtransfer.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-msgtransfer.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-msgtransfer.labels" -}} -helm.sh/chart: {{ include "openim-msgtransfer.chart" . }} -{{ include "openim-msgtransfer.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-msgtransfer.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-msgtransfer.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-msgtransfer.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-msgtransfer.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-msgtransfer/templates/deployment.yaml b/deployments/charts/openim-msgtransfer/templates/deployment.yaml deleted file mode 100644 index 019e307d52..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-msgtransfer.fullname" . }} - labels: - {{- include "openim-msgtransfer.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-msgtransfer.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-msgtransfer.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-msgtransfer.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-msgtransfer/templates/hpa.yaml b/deployments/charts/openim-msgtransfer/templates/hpa.yaml deleted file mode 100644 index 89921bf300..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-msgtransfer.fullname" . }} - labels: - {{- include "openim-msgtransfer.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-msgtransfer.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msgtransfer/templates/ingress.yaml b/deployments/charts/openim-msgtransfer/templates/ingress.yaml deleted file mode 100644 index ab28a9e718..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-msgtransfer.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-msgtransfer.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msgtransfer/templates/service.yaml b/deployments/charts/openim-msgtransfer/templates/service.yaml deleted file mode 100644 index 467f7d13c5..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-msgtransfer.fullname" . }} - labels: - {{- include "openim-msgtransfer.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-msgtransfer.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-msgtransfer/templates/serviceaccount.yaml b/deployments/charts/openim-msgtransfer/templates/serviceaccount.yaml deleted file mode 100644 index 78816bd802..0000000000 --- a/deployments/charts/openim-msgtransfer/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-msgtransfer.serviceAccountName" . }} - labels: - {{- include "openim-msgtransfer.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-msgtransfer/values.yaml b/deployments/charts/openim-msgtransfer/values.yaml deleted file mode 100644 index 6e26d72c8f..0000000000 --- a/deployments/charts/openim-msgtransfer/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-msgtransfer. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-msgtransfer - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-push/.helmignore b/deployments/charts/openim-push/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-push/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-push/Chart.yaml b/deployments/charts/openim-push/Chart.yaml deleted file mode 100644 index 966769b00c..0000000000 --- a/deployments/charts/openim-push/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-push -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-push/templates/NOTES.txt b/deployments/charts/openim-push/templates/NOTES.txt deleted file mode 100644 index 625c390509..0000000000 --- a/deployments/charts/openim-push/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-push.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-push.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-push.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-push.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-push/templates/_helpers.tpl b/deployments/charts/openim-push/templates/_helpers.tpl deleted file mode 100644 index 0504284719..0000000000 --- a/deployments/charts/openim-push/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-push.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-push.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-push.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-push.labels" -}} -helm.sh/chart: {{ include "openim-push.chart" . }} -{{ include "openim-push.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-push.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-push.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-push.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-push.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-push/templates/deployment.yaml b/deployments/charts/openim-push/templates/deployment.yaml deleted file mode 100644 index 86c27d14c2..0000000000 --- a/deployments/charts/openim-push/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-push.fullname" . }} - labels: - {{- include "openim-push.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-push.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-push.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-push.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-push/templates/hpa.yaml b/deployments/charts/openim-push/templates/hpa.yaml deleted file mode 100644 index 40c77b0481..0000000000 --- a/deployments/charts/openim-push/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-push.fullname" . }} - labels: - {{- include "openim-push.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-push.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-push/templates/ingress.yaml b/deployments/charts/openim-push/templates/ingress.yaml deleted file mode 100644 index 6638f256de..0000000000 --- a/deployments/charts/openim-push/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-push.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-push.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-push/templates/service.yaml b/deployments/charts/openim-push/templates/service.yaml deleted file mode 100644 index c2ef8db358..0000000000 --- a/deployments/charts/openim-push/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-push.fullname" . }} - labels: - {{- include "openim-push.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-push.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-push/templates/serviceaccount.yaml b/deployments/charts/openim-push/templates/serviceaccount.yaml deleted file mode 100644 index 66dfedfdff..0000000000 --- a/deployments/charts/openim-push/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-push.serviceAccountName" . }} - labels: - {{- include "openim-push.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-push/values.yaml b/deployments/charts/openim-push/values.yaml deleted file mode 100644 index 3348fe79da..0000000000 --- a/deployments/charts/openim-push/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-push. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-push - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-auth/.helmignore b/deployments/charts/openim-rpc-auth/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-auth/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-auth/Chart.yaml b/deployments/charts/openim-rpc-auth/Chart.yaml deleted file mode 100644 index 8e8fb03b4b..0000000000 --- a/deployments/charts/openim-rpc-auth/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-auth -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-auth/templates/NOTES.txt b/deployments/charts/openim-rpc-auth/templates/NOTES.txt deleted file mode 100644 index 220602077f..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-auth.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-auth.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-auth.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-auth.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-auth/templates/_helpers.tpl b/deployments/charts/openim-rpc-auth/templates/_helpers.tpl deleted file mode 100644 index cb65758726..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-auth.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-auth.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-auth.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-auth.labels" -}} -helm.sh/chart: {{ include "openim-rpc-auth.chart" . }} -{{ include "openim-rpc-auth.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-auth.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-auth.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-auth.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-auth.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-auth/templates/deployment.yaml b/deployments/charts/openim-rpc-auth/templates/deployment.yaml deleted file mode 100644 index 98c43ecb75..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-auth.fullname" . }} - labels: - {{- include "openim-rpc-auth.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-auth.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-auth.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-auth.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-auth/templates/hpa.yaml b/deployments/charts/openim-rpc-auth/templates/hpa.yaml deleted file mode 100644 index e99536cf1c..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-auth.fullname" . }} - labels: - {{- include "openim-rpc-auth.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-auth.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-auth/templates/ingress.yaml b/deployments/charts/openim-rpc-auth/templates/ingress.yaml deleted file mode 100644 index ece395de7a..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-auth.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-auth.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-auth/templates/service.yaml b/deployments/charts/openim-rpc-auth/templates/service.yaml deleted file mode 100644 index 7855123470..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-auth.fullname" . }} - labels: - {{- include "openim-rpc-auth.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-auth.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-auth/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-auth/templates/serviceaccount.yaml deleted file mode 100644 index 555d4f6ff8..0000000000 --- a/deployments/charts/openim-rpc-auth/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-auth.serviceAccountName" . }} - labels: - {{- include "openim-rpc-auth.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-auth/values.yaml b/deployments/charts/openim-rpc-auth/values.yaml deleted file mode 100644 index 93fa68b87c..0000000000 --- a/deployments/charts/openim-rpc-auth/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-auth. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-auth - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-conversation/.helmignore b/deployments/charts/openim-rpc-conversation/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-conversation/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-conversation/Chart.yaml b/deployments/charts/openim-rpc-conversation/Chart.yaml deleted file mode 100644 index 0ca8f55133..0000000000 --- a/deployments/charts/openim-rpc-conversation/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-conversation -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-rpc-conversation/templates/NOTES.txt b/deployments/charts/openim-rpc-conversation/templates/NOTES.txt deleted file mode 100644 index 287f2fd640..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-conversation.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-conversation.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-conversation.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-conversation.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-conversation/templates/_helpers.tpl b/deployments/charts/openim-rpc-conversation/templates/_helpers.tpl deleted file mode 100644 index 184271057e..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-conversation.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-conversation.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-conversation.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-conversation.labels" -}} -helm.sh/chart: {{ include "openim-rpc-conversation.chart" . }} -{{ include "openim-rpc-conversation.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-conversation.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-conversation.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-conversation.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-conversation.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-conversation/templates/deployment.yaml b/deployments/charts/openim-rpc-conversation/templates/deployment.yaml deleted file mode 100644 index 6dcb001f4b..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-conversation.fullname" . }} - labels: - {{- include "openim-rpc-conversation.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-conversation.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-conversation.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-conversation.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-conversation/templates/hpa.yaml b/deployments/charts/openim-rpc-conversation/templates/hpa.yaml deleted file mode 100644 index 5242455620..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-conversation.fullname" . }} - labels: - {{- include "openim-rpc-conversation.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-conversation.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-conversation/templates/ingress.yaml b/deployments/charts/openim-rpc-conversation/templates/ingress.yaml deleted file mode 100644 index 078c472b86..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-conversation.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-conversation.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-conversation/templates/service.yaml b/deployments/charts/openim-rpc-conversation/templates/service.yaml deleted file mode 100644 index 8559c4d11d..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-conversation.fullname" . }} - labels: - {{- include "openim-rpc-conversation.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-conversation.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-conversation/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-conversation/templates/serviceaccount.yaml deleted file mode 100644 index 14b1b21290..0000000000 --- a/deployments/charts/openim-rpc-conversation/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-conversation.serviceAccountName" . }} - labels: - {{- include "openim-rpc-conversation.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-conversation/values.yaml b/deployments/charts/openim-rpc-conversation/values.yaml deleted file mode 100644 index bb88ab6133..0000000000 --- a/deployments/charts/openim-rpc-conversation/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-conversation. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-conversation - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-friend/.helmignore b/deployments/charts/openim-rpc-friend/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-friend/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-friend/Chart.yaml b/deployments/charts/openim-rpc-friend/Chart.yaml deleted file mode 100644 index 62e92db9b1..0000000000 --- a/deployments/charts/openim-rpc-friend/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-friend -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" diff --git a/deployments/charts/openim-rpc-friend/templates/NOTES.txt b/deployments/charts/openim-rpc-friend/templates/NOTES.txt deleted file mode 100644 index 004ee5c5ec..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-friend.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-friend.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-friend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-friend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-friend/templates/_helpers.tpl b/deployments/charts/openim-rpc-friend/templates/_helpers.tpl deleted file mode 100644 index 83719fb314..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-friend.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-friend.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-friend.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-friend.labels" -}} -helm.sh/chart: {{ include "openim-rpc-friend.chart" . }} -{{ include "openim-rpc-friend.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-friend.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-friend.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-friend.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-friend.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-friend/templates/deployment.yaml b/deployments/charts/openim-rpc-friend/templates/deployment.yaml deleted file mode 100644 index 01251cdfac..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-friend.fullname" . }} - labels: - {{- include "openim-rpc-friend.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-friend.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-friend.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-friend.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-friend/templates/hpa.yaml b/deployments/charts/openim-rpc-friend/templates/hpa.yaml deleted file mode 100644 index ae88e2621e..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-friend.fullname" . }} - labels: - {{- include "openim-rpc-friend.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-friend.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-friend/templates/ingress.yaml b/deployments/charts/openim-rpc-friend/templates/ingress.yaml deleted file mode 100644 index 0845aa783e..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-friend.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-friend.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-friend/templates/service.yaml b/deployments/charts/openim-rpc-friend/templates/service.yaml deleted file mode 100644 index 892a007dd7..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-friend.fullname" . }} - labels: - {{- include "openim-rpc-friend.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-friend.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-friend/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-friend/templates/serviceaccount.yaml deleted file mode 100644 index 5146d6781a..0000000000 --- a/deployments/charts/openim-rpc-friend/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-friend.serviceAccountName" . }} - labels: - {{- include "openim-rpc-friend.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-friend/values.yaml b/deployments/charts/openim-rpc-friend/values.yaml deleted file mode 100644 index 34dcda9dae..0000000000 --- a/deployments/charts/openim-rpc-friend/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-friend. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-friend - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-group/.helmignore b/deployments/charts/openim-rpc-group/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-group/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-group/Chart.yaml b/deployments/charts/openim-rpc-group/Chart.yaml deleted file mode 100644 index c3f7e3bfa6..0000000000 --- a/deployments/charts/openim-rpc-group/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-group -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-group/templates/NOTES.txt b/deployments/charts/openim-rpc-group/templates/NOTES.txt deleted file mode 100644 index 0cc117a490..0000000000 --- a/deployments/charts/openim-rpc-group/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-group.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-group.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-group.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-group.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-group/templates/_helpers.tpl b/deployments/charts/openim-rpc-group/templates/_helpers.tpl deleted file mode 100644 index 7835b84e1d..0000000000 --- a/deployments/charts/openim-rpc-group/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-group.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-group.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-group.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-group.labels" -}} -helm.sh/chart: {{ include "openim-rpc-group.chart" . }} -{{ include "openim-rpc-group.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-group.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-group.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-group.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-group.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-group/templates/deployment.yaml b/deployments/charts/openim-rpc-group/templates/deployment.yaml deleted file mode 100644 index e738f33be2..0000000000 --- a/deployments/charts/openim-rpc-group/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-group.fullname" . }} - labels: - {{- include "openim-rpc-group.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-group.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-group.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-group.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-group/templates/hpa.yaml b/deployments/charts/openim-rpc-group/templates/hpa.yaml deleted file mode 100644 index 91f313abef..0000000000 --- a/deployments/charts/openim-rpc-group/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-group.fullname" . }} - labels: - {{- include "openim-rpc-group.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-group.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-group/templates/ingress.yaml b/deployments/charts/openim-rpc-group/templates/ingress.yaml deleted file mode 100644 index e3cad781ac..0000000000 --- a/deployments/charts/openim-rpc-group/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-group.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-group.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-group/templates/service.yaml b/deployments/charts/openim-rpc-group/templates/service.yaml deleted file mode 100644 index 42e1f78ca5..0000000000 --- a/deployments/charts/openim-rpc-group/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-group.fullname" . }} - labels: - {{- include "openim-rpc-group.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-group.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-group/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-group/templates/serviceaccount.yaml deleted file mode 100644 index 304bbda569..0000000000 --- a/deployments/charts/openim-rpc-group/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-group.serviceAccountName" . }} - labels: - {{- include "openim-rpc-group.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-group/values.yaml b/deployments/charts/openim-rpc-group/values.yaml deleted file mode 100644 index f04c641474..0000000000 --- a/deployments/charts/openim-rpc-group/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-group. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-group - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-msg/.helmignore b/deployments/charts/openim-rpc-msg/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-msg/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-msg/Chart.yaml b/deployments/charts/openim-rpc-msg/Chart.yaml deleted file mode 100644 index c32fe64c19..0000000000 --- a/deployments/charts/openim-rpc-msg/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-msg -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-msg/templates/NOTES.txt b/deployments/charts/openim-rpc-msg/templates/NOTES.txt deleted file mode 100644 index 65033b1075..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-msg.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-msg.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-msg.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-msg.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-msg/templates/_helpers.tpl b/deployments/charts/openim-rpc-msg/templates/_helpers.tpl deleted file mode 100644 index da69568222..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-msg.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-msg.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-msg.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-msg.labels" -}} -helm.sh/chart: {{ include "openim-rpc-msg.chart" . }} -{{ include "openim-rpc-msg.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-msg.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-msg.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-msg.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-msg.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-msg/templates/deployment.yaml b/deployments/charts/openim-rpc-msg/templates/deployment.yaml deleted file mode 100644 index f7267fabbc..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-msg.fullname" . }} - labels: - {{- include "openim-rpc-msg.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-msg.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-msg.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-msg.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-msg/templates/hpa.yaml b/deployments/charts/openim-rpc-msg/templates/hpa.yaml deleted file mode 100644 index 0e6dde3695..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-msg.fullname" . }} - labels: - {{- include "openim-rpc-msg.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-msg.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-msg/templates/ingress.yaml b/deployments/charts/openim-rpc-msg/templates/ingress.yaml deleted file mode 100644 index 2ba5873381..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-msg.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-msg.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-msg/templates/service.yaml b/deployments/charts/openim-rpc-msg/templates/service.yaml deleted file mode 100644 index ba403d5abf..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-msg.fullname" . }} - labels: - {{- include "openim-rpc-msg.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-msg.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-msg/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-msg/templates/serviceaccount.yaml deleted file mode 100644 index 70fd820696..0000000000 --- a/deployments/charts/openim-rpc-msg/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-msg.serviceAccountName" . }} - labels: - {{- include "openim-rpc-msg.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-msg/values.yaml b/deployments/charts/openim-rpc-msg/values.yaml deleted file mode 100644 index cf2f4e84dc..0000000000 --- a/deployments/charts/openim-rpc-msg/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-msg. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-msg - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-third/.helmignore b/deployments/charts/openim-rpc-third/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-third/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-third/Chart.yaml b/deployments/charts/openim-rpc-third/Chart.yaml deleted file mode 100644 index ff624aa341..0000000000 --- a/deployments/charts/openim-rpc-third/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-third -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-third/templates/NOTES.txt b/deployments/charts/openim-rpc-third/templates/NOTES.txt deleted file mode 100644 index a2228c84d9..0000000000 --- a/deployments/charts/openim-rpc-third/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-third.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-third.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-third.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-third.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-third/templates/_helpers.tpl b/deployments/charts/openim-rpc-third/templates/_helpers.tpl deleted file mode 100644 index 46039ce2ce..0000000000 --- a/deployments/charts/openim-rpc-third/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-third.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-third.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-third.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-third.labels" -}} -helm.sh/chart: {{ include "openim-rpc-third.chart" . }} -{{ include "openim-rpc-third.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-third.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-third.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-third.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-third.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-third/templates/deployment.yaml b/deployments/charts/openim-rpc-third/templates/deployment.yaml deleted file mode 100644 index 7794155359..0000000000 --- a/deployments/charts/openim-rpc-third/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-third.fullname" . }} - labels: - {{- include "openim-rpc-third.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-third.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-third.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-third.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-third/templates/hpa.yaml b/deployments/charts/openim-rpc-third/templates/hpa.yaml deleted file mode 100644 index f20ecb973a..0000000000 --- a/deployments/charts/openim-rpc-third/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-third.fullname" . }} - labels: - {{- include "openim-rpc-third.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-third.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-third/templates/ingress.yaml b/deployments/charts/openim-rpc-third/templates/ingress.yaml deleted file mode 100644 index 1c64ac5451..0000000000 --- a/deployments/charts/openim-rpc-third/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-third.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-third.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-third/templates/service.yaml b/deployments/charts/openim-rpc-third/templates/service.yaml deleted file mode 100644 index af112794e8..0000000000 --- a/deployments/charts/openim-rpc-third/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-third.fullname" . }} - labels: - {{- include "openim-rpc-third.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-third.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-third/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-third/templates/serviceaccount.yaml deleted file mode 100644 index 27f2bf067f..0000000000 --- a/deployments/charts/openim-rpc-third/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-third.serviceAccountName" . }} - labels: - {{- include "openim-rpc-third.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-third/values.yaml b/deployments/charts/openim-rpc-third/values.yaml deleted file mode 100644 index 71d9a3ede2..0000000000 --- a/deployments/charts/openim-rpc-third/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-third. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-third - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/charts/openim-rpc-user/.helmignore b/deployments/charts/openim-rpc-user/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deployments/charts/openim-rpc-user/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/charts/openim-rpc-user/Chart.yaml b/deployments/charts/openim-rpc-user/Chart.yaml deleted file mode 100644 index feb5a31957..0000000000 --- a/deployments/charts/openim-rpc-user/Chart.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v2 -name: openim-rpc-user -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" - -icon: https://raw.githubusercontent.com/openimsdk/open-im-server/main/assets/openim-logo-gradient.svg - -maintainers: - - name: "OpenIM" - url: "https://github.com/openimsdk" - -keywords: - - openim - - im - - chat - -sources: - - "https://github.com/openimsdk/open-im-server" - - "https://github.com/openimsdk/helm-charts" \ No newline at end of file diff --git a/deployments/charts/openim-rpc-user/templates/NOTES.txt b/deployments/charts/openim-rpc-user/templates/NOTES.txt deleted file mode 100644 index 9928bd1620..0000000000 --- a/deployments/charts/openim-rpc-user/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "openim-rpc-user.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "openim-rpc-user.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "openim-rpc-user.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openim-rpc-user.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployments/charts/openim-rpc-user/templates/_helpers.tpl b/deployments/charts/openim-rpc-user/templates/_helpers.tpl deleted file mode 100644 index 473f66556f..0000000000 --- a/deployments/charts/openim-rpc-user/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openim-rpc-user.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "openim-rpc-user.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openim-rpc-user.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openim-rpc-user.labels" -}} -helm.sh/chart: {{ include "openim-rpc-user.chart" . }} -{{ include "openim-rpc-user.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openim-rpc-user.selectorLabels" -}} -app.kubernetes.io/name: {{ include "openim-rpc-user.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openim-rpc-user.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "openim-rpc-user.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-user/templates/deployment.yaml b/deployments/charts/openim-rpc-user/templates/deployment.yaml deleted file mode 100644 index 26497d837e..0000000000 --- a/deployments/charts/openim-rpc-user/templates/deployment.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "openim-rpc-user.fullname" . }} - labels: - {{- include "openim-rpc-user.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "openim-rpc-user.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "openim-rpc-user.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "openim-rpc-user.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: webhook - containerPort: 80 - protocol: TCP - #livenessProbe: - # httpGet: - # path: / - # port: webhook - #readinessProbe: - # httpGet: - # path: / - # port: webhook - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /openim/openim-server/config/config.yaml - name: config - subPath: config.yaml - - mountPath: /openim/openim-server/config/ - name: config - subPath: notification.yaml - volumes: - - name: config - configMap: - name: openim-cm - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployments/charts/openim-rpc-user/templates/hpa.yaml b/deployments/charts/openim-rpc-user/templates/hpa.yaml deleted file mode 100644 index 012b15ae38..0000000000 --- a/deployments/charts/openim-rpc-user/templates/hpa.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "openim-rpc-user.fullname" . }} - labels: - {{- include "openim-rpc-user.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "openim-rpc-user.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-user/templates/ingress.yaml b/deployments/charts/openim-rpc-user/templates/ingress.yaml deleted file mode 100644 index 38aa6fdff8..0000000000 --- a/deployments/charts/openim-rpc-user/templates/ingress.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "openim-rpc-user.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "openim-rpc-user.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-user/templates/service.yaml b/deployments/charts/openim-rpc-user/templates/service.yaml deleted file mode 100644 index af8a53e195..0000000000 --- a/deployments/charts/openim-rpc-user/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "openim-rpc-user.fullname" . }} - labels: - {{- include "openim-rpc-user.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: webhook - protocol: TCP - name: webhook - selector: - {{- include "openim-rpc-user.selectorLabels" . | nindent 4 }} diff --git a/deployments/charts/openim-rpc-user/templates/serviceaccount.yaml b/deployments/charts/openim-rpc-user/templates/serviceaccount.yaml deleted file mode 100644 index ebe3e3d683..0000000000 --- a/deployments/charts/openim-rpc-user/templates/serviceaccount.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openim-rpc-user.serviceAccountName" . }} - labels: - {{- include "openim-rpc-user.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deployments/charts/openim-rpc-user/values.yaml b/deployments/charts/openim-rpc-user/values.yaml deleted file mode 100644 index 4f1ad7ede2..0000000000 --- a/deployments/charts/openim-rpc-user/values.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default values for openim-rpc-user. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: ghcr.io/openimsdk/openim-rpc-user - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deployments/templates/alertmanager.yml b/deployments/templates/alertmanager.yml deleted file mode 100644 index 4e390b2bbc..0000000000 --- a/deployments/templates/alertmanager.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -###################### AlertManager Configuration ###################### -# AlertManager configuration using environment variables -# -# Resolve timeout -# SMTP configuration for sending alerts -# Templates for email notifications -# Routing configurations for alerts -# Receiver configurations -global: - resolve_timeout: ${ALERTMANAGER_RESOLVE_TIMEOUT} - smtp_from: ${ALERTMANAGER_SMTP_FROM} - smtp_smarthost: ${ALERTMANAGER_SMTP_SMARTHOST} - smtp_auth_username: ${ALERTMANAGER_SMTP_AUTH_USERNAME} - smtp_auth_password: ${ALERTMANAGER_SMTP_AUTH_PASSWORD} - smtp_require_tls: ${ALERTMANAGER_SMTP_REQUIRE_TLS} - smtp_hello: ${ALERTMANAGER_SMTP_HELLO} - -templates: - - /etc/alertmanager/email.tmpl - -route: - group_by: ['alertname'] - group_wait: 5s - group_interval: 5s - repeat_interval: 5m - receiver: email -receivers: - - name: email - email_configs: - - to: '${ALERTMANAGER_EMAIL_TO}' - html: '{{ template "email.to.html" . }}' - headers: { Subject: "[OPENIM-SERVER]Alarm" } - send_resolved: true diff --git a/deployments/templates/charts-value.yaml b/deployments/templates/charts-value.yaml deleted file mode 100644 index 26bbe2926a..0000000000 --- a/deployments/templates/charts-value.yaml +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#This configuration file is used to override the use of the value.yaml variable. -#Currently, only the configuration with ingressName as nginx is provided. -#If it is another gateway such as istio or treafik, please modify the corresponding gateway requirements - -global: - commonRepository: ghcr.io/openimsdk - commonTag: "latest" - pullPolicy: Always - -openim-api: - image: - repository: ghcr.io/openimsdk/openim-api - pullPolicy: Always - tag: "latest" - ingress: - enabled: true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - hosts: - - host: openim.server.com # your hostname - paths: - - path: /api(/|$)(.*) - pathType: ImplementationSpecific - tls: - - secretName: webapitls #your hostname tls - hosts: - - openim.server.com - -openim-msggateway: - image: - repository: ghcr.io/openimsdk/openim-msggateway - tag: "latest" - pullPolicy: Always - ingress: - enabled: true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - hosts: - - host: openim.server.com # your hostname - paths: - - path: /msg_gateway(/|$)(.*) - pathType: ImplementationSpecific - tls: - - secretName: webapitls #your hostname tls - hosts: - - openim.server.com - -openim-msgtransfer: - image: - repository: ghcr.io/openimsdk/openim-msgtransfer - tag: "latest" - pullPolicy: Always -openim-push: - image: - repository: ghcr.io/openimsdk/openim-push - tag: "latest" - pullPolicy: Always -openim-rpc-auth: - image: - repository: ghcr.io/openimsdk/openim-rpc-auth - tag: "latest" - pullPolicy: Always -openim-rpc-conversation: - image: - repository: ghcr.io/openimsdk/openim-rpc-conversation - tag: "latest" - pullPolicy: Always -openim-rpc-friend: - image: - repository: ghcr.io/openimsdk/openim-rpc-friend - tag: "latest" - pullPolicy: Always -openim-rpc-group: - image: - repository: ghcr.io/openimsdk/openim-rpc-group - tag: "latest" - pullPolicy: Always -openim-rpc-msg: - image: - repository: ghcr.io/openimsdk/openim-rpc-msg - tag: "latest" - pullPolicy: Always -openim-rpc-third: - image: - repository: ghcr.io/openimsdk/openim-rpc-third - tag: "latest" - pullPolicy: Always -openim-rpc-user: - image: - repository: ghcr.io/openimsdk/openim-rpc-user - tag: "latest" - pullPolicy: Always diff --git a/deployments/templates/config.yaml b/deployments/templates/config.yaml deleted file mode 100644 index c108de5e8c..0000000000 --- a/deployments/templates/config.yaml +++ /dev/null @@ -1,573 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the License); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ----------------------------------------------------------------- -# TODO: This config file is the template file -# --| source: deployments/templates/config.yaml -# --| env: scripts/install/environment -# --| target: config/config.yaml -# ----------------------------------------------------------------- - -envs: - discovery: ${ENVS_DISCOVERY} - -###################### Zookeeper ###################### -# Zookeeper configuration -# It's not recommended to modify the schema -# -# Zookeeper address -# Zookeeper username -# Zookeeper password -zookeeper: - schema: ${ZOOKEEPER_SCHEMA} - address: [ ${ZOOKEEPER_ADDRESS}:${ZOOKEEPER_PORT} ] - username: ${ZOOKEEPER_USERNAME} - password: ${ZOOKEEPER_PASSWORD} - -###################### Mongo ###################### -# MongoDB configuration - -# If uri is not empty, it will be used directly for the MongoDB connection. -# This is a complete MongoDB URI string. -# Example: mongodb://user:password@host1:port1,host2:port2/dbname?options -mongo: - uri: ${MONGO_URI} - -# List of MongoDB server addresses. -# Used for constructing the MongoDB URI if 'uri' above is empty. -# For a standalone setup, specify the address of the single server. -# For a sharded cluster, specify the addresses of the Mongos servers. -# Example: [ '172.28.0.1:37017', '172.28.0.2:37017' ] -# Default MongoDB database name -# Maximum connection pool size - address: [ ${MONGO_ADDRESS}:${MONGO_PORT} ] - database: ${MONGO_DATABASE} - username: ${MONGO_OPENIM_USERNAME} - password: ${MONGO_OPENIM_PASSWORD} - maxPoolSize: ${MONGO_MAX_POOL_SIZE} - -###################### Redis configuration information ###################### -# Redis configuration -# -# Username is required only for Redis version 6.0+ -redis: - address: [ ${REDIS_ADDRESS}:${REDIS_PORT} ] - username: ${REDIS_USERNAME} - password: ${REDIS_PASSWORD} - -###################### Kafka configuration information ###################### -# Kafka configuration -# -# Kafka username -# Kafka password -# It's not recommended to modify this topic name -# Consumer group ID, it's not recommended to modify -kafka: - username: ${KAFKA_USERNAME} - password: ${KAFKA_PASSWORD} - addr: [ ${KAFKA_ADDRESS}:${KAFKA_PORT} ] - latestMsgToRedis: - topic: "${KAFKA_LATESTMSG_REDIS_TOPIC}" - offlineMsgToMongo: - topic: "${KAFKA_OFFLINEMSG_MONGO_TOPIC}" - msgToPush: - topic: "${KAFKA_MSG_PUSH_TOPIC}" - consumerGroupID: - msgToRedis: ${KAFKA_CONSUMERGROUPID_REDIS} - msgToMongo: ${KAFKA_CONSUMERGROUPID_MONGO} - msgToMySql: ${KAFKA_CONSUMERGROUPID_MYSQL} - msgToPush: ${KAFKA_CONSUMERGROUPID_PUSH} - -###################### RPC configuration information ###################### -# RPC configuration -# -# IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway -# Default listen IP is 0.0.0.0 -rpc: - registerIP: ${RPC_REGISTER_IP} - listenIP: ${RPC_LISTEN_IP} - -###################### API configuration information ###################### -# API configuration -# -# API service port -# Default listen IP is 0.0.0.0 -api: - openImApiPort: [ ${API_OPENIM_PORT} ] - listenIP: ${API_LISTEN_IP} - -###################### Object configuration information ###################### -# Object storage configuration -# -# Use minio for object storage -# API URL should be accessible by the app -# It's not recommended to modify the bucket name -# Endpoint should be accessible by the app -# Session token -# Configuration for Tencent COS -# Configuration for Aliyun OSS -# apiURL is the address of the api, the access address of the app, use s3 must be configured -# minio.endpoint can be configured as an intranet address, -# minio.signEndpoint is minio public network address -object: - enable: "${OBJECT_ENABLE}" - apiURL: "${OBJECT_APIURL}" - minio: - bucket: "${MINIO_BUCKET}" - endpoint: "${MINIO_ENDPOINT}" - accessKeyID: "${MINIO_ACCESS_KEY}" - secretAccessKey: "${MINIO_SECRET_KEY}" - sessionToken: ${MINIO_SESSION_TOKEN} - signEndpoint: "${MINIO_SIGN_ENDPOINT}" - publicRead: ${MINIO_PUBLIC_READ} - cos: - bucketURL: ${COS_BUCKET_URL} - secretID: ${COS_SECRET_ID} - secretKey: ${COS_SECRET_KEY} - sessionToken: ${COS_SESSION_TOKEN} - publicRead: ${COS_PUBLIC_READ} - oss: - endpoint: "${OSS_ENDPOINT}" - bucket: "${OSS_BUCKET}" - bucketURL: "${OSS_BUCKET_URL}" - accessKeyID: ${OSS_ACCESS_KEY_ID} - accessKeySecret: ${OSS_ACCESS_KEY_SECRET} - sessionToken: ${OSS_SESSION_TOKEN} - publicRead: ${OSS_PUBLIC_READ} - kodo: - endpoint: "${KODO_ENDPOINT}" - bucket: "${KODO_BUCKET}" - bucketURL: "${KODO_BUCKET_URL}" - accessKeyID: ${KODO_ACCESS_KEY_ID} - accessKeySecret: ${KODO_ACCESS_KEY_SECRET} - sessionToken: ${KODO_SESSION_TOKEN} - publicRead: ${KODO_PUBLIC_READ} - aws: - endpoint: "${AWS_ENDPOINT}" # This might not be necessary unless you're using a custom endpoint - region: "${AWS_REGION}" - bucket: "${AWS_BUCKET}" - accessKeyID: ${AWS_ACCESS_KEY_ID} - accessKeySecret: ${AWS_SECRET_ACCESS_KEY} - publicRead: ${AWS_PUBLIC_READ} - -###################### RPC Port Configuration ###################### -# RPC service ports -# These ports are passed into the program by the script and are not recommended to modify -# For launching multiple programs, just fill in multiple ports separated by commas -# For example, [10110, 10111] -rpcPort: - openImUserPort: [ ${OPENIM_USER_PORT} ] - openImFriendPort: [ ${OPENIM_FRIEND_PORT} ] - openImMessagePort: [ ${OPENIM_MESSAGE_PORT} ] - openImGroupPort: [ ${OPENIM_GROUP_PORT} ] - openImAuthPort: [ ${OPENIM_AUTH_PORT} ] - openImPushPort: [ ${OPENIM_PUSH_PORT} ] - openImConversationPort: [ ${OPENIM_CONVERSATION_PORT} ] - openImThirdPort: [ ${OPENIM_THIRD_PORT} ] - -###################### RPC Register Name Configuration ###################### -# RPC service names for registration, it's not recommended to modify these -rpcRegisterName: - openImUserName: ${OPENIM_USER_NAME} - openImFriendName: ${OPENIM_FRIEND_NAME} - openImMsgName: ${OPENIM_MSG_NAME} - openImPushName: ${OPENIM_PUSH_NAME} - openImMessageGatewayName: ${OPENIM_MESSAGE_GATEWAY_NAME} - openImGroupName: ${OPENIM_GROUP_NAME} - openImAuthName: ${OPENIM_AUTH_NAME} - openImConversationName: ${OPENIM_CONVERSATION_NAME} - openImThirdName: ${OPENIM_THIRD_NAME} - -###################### Log Configuration ###################### -# Log configuration -# -# Storage directory -# Log rotation time -# Maximum number of logs to retain -# Log level, 6 means all levels -# Whether to output to stdout -# Whether to output in json format -# Whether to include stack trace in logs -log: - storageLocation: ${LOG_STORAGE_LOCATION} - rotationTime: ${LOG_ROTATION_TIME} - remainRotationCount: ${LOG_REMAIN_ROTATION_COUNT} - remainLogLevel: ${LOG_REMAIN_LOG_LEVEL} - isStdout: ${LOG_IS_STDOUT} - isJson: ${LOG_IS_JSON} - withStack: ${LOG_WITH_STACK} - -###################### Variables definition ###################### -# Long connection server configuration -# -# Websocket port for msg_gateway -# Maximum number of websocket connections -# Maximum length of websocket request package -# Websocket connection handshake timeout -longConnSvr: - openImWsPort: [ ${OPENIM_WS_PORT} ] - websocketMaxConnNum: ${WEBSOCKET_MAX_CONN_NUM} - openImMessageGatewayPort: [ ${OPENIM_MESSAGE_GATEWAY_PORT} ] - websocketMaxMsgLen: ${WEBSOCKET_MAX_MSG_LEN} - websocketTimeout: ${WEBSOCKET_TIMEOUT} - -# Push notification service configuration -# -# Use GeTui for push notifications -# GeTui offline push configuration -# FCM offline push configuration -# Account file, place it in the config directory -# JPush configuration, modify these after applying in JPush backend -push: - enable: ${PUSH_ENABLE} - geTui: - pushUrl: "${GETUI_PUSH_URL}" - masterSecret: ${GETUI_MASTER_SECRET} - appKey: ${GETUI_APP_KEY} - intent: ${GETUI_INTENT} - channelID: ${GETUI_CHANNEL_ID} - channelName: ${GETUI_CHANNEL_NAME} - fcm: - serviceAccount: "${FCM_SERVICE_ACCOUNT}" - jpush: - appKey: ${JPUSH_APP_KEY} - masterSecret: ${JPUSH_MASTER_SECRET} - pushUrl: ${JPUSH_PUSH_URL} - pushIntent: ${JPUSH_PUSH_INTENT} - -# App manager configuration -# -# Built-in app manager user IDs -# Built-in app manager nicknames -# Attention, this configure is discarded. If you have used him before, configure your own -manager: - userID: - nickname: - -# chatAdmin, use for send notification -# -# Built-in app system notification account ID -# Built-in app system notification account nickname -im-admin: - userID: [ "${IM_ADMIN_USERID}" ] - nickname: [ "${IM_ADMIN_NAME}" ] - -# Multi-platform login policy -# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time -multiLoginPolicy: ${MULTILOGIN_POLICY} - -# Whether to store messages in MySQL, messages in MySQL are only used for management background -chatPersistenceMysql: ${CHAT_PERSISTENCE_MYSQL} - -# Message cache timeout in seconds, it's not recommended to modify -msgCacheTimeout: ${MSG_CACHE_TIMEOUT} - -# Whether to enable read receipts for group chat -groupMessageHasReadReceiptEnable: ${GROUP_MSG_READ_RECEIPT} - -# Whether to enable read receipts for single chat -singleMessageHasReadReceiptEnable: ${SINGLE_MSG_READ_RECEIPT} - -# MongoDB offline message retention period in days -retainChatRecords: ${RETAIN_CHAT_RECORDS} - -# Schedule to clear expired messages(older than retainChatRecords days) in MongoDB every Wednesday at 2am -# This deletion is just for cleaning up disk usage according to previous configuration retainChatRecords, no notification will be sent -chatRecordsClearTime: "${CHAT_RECORDS_CLEAR_TIME}" - -# Schedule to auto delete messages every day at 2am -# This deletion is for messages that have been retained for more than msg_destruct_time (seconds) in the conversation field -msgDestructTime: "${MSG_DESTRUCT_TIME}" - -# Secret key -secret: ${SECRET} - -# Token policy -# -# Token expiration period in days -tokenPolicy: - expire: ${TOKEN_EXPIRE} - -# Message verification policy -# -# Whether to verify friendship when sending messages -messageVerify: - friendVerify: false - -# iOS push notification configuration -# -# iOS push notification sound -# Whether to count badge -# Whether it's production environment -iosPush: - pushSound: "xxx" - badgeCount: true - production: false - -###################### Third-party service configuration ###################### -# Callback configuration -# -# Callback URL -# Whether to enable this callback event -# Timeout in seconds -# Whether to continue execution if callback fails -callback: - url: "webhook://127.0.0.1:10008/callbackExample" - beforeSendSingleMsg: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeUpdateUserInfoEx: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterUpdateUserInfoEx: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterSendSingleMsg: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeSendGroupMsg: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterSendGroupMsg: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - msgModify: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - userOnline: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - userOffline: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - userKickOff: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - offlinePush: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - onlinePush: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - superGroupOnlinePush: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeAddFriend: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeUpdateUserInfo: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeCreateGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterCreateGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeMemberJoinGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeSetGroupMemberInfo: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterSetGroupMemberInfo: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - setMessageReactionExtensions: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - quitGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - killGroupMember: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - dismissGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - joinGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - groupMsgRead: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - singleMsgRead: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - updateUserInfo: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeUserRegister: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterUserRegister: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - transferGroupOwner: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeSetFriendRemark: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterSetFriendRemark: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterGroupMsgRead: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterGroupMsgRevoke: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - afterJoinGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - beforeInviteUserToGroup: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - joinGroupAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - setGroupInfoAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - setGroupInfoBefore: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - revokeMsgAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - addBlackBefore: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - addFriendAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - addFriendAgreeBefore: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - deleteFriendAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - importFriendsBefore: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - importFriendsAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} - removeBlackAfter: - enable: ${CALLBACK_ENABLE} - timeout: ${CALLBACK_TIMEOUT} - failedContinue: ${CALLBACK_FAILED_CONTINUE} -###################### Prometheus ###################### -# Prometheus configuration for various services -# The number of Prometheus ports per service needs to correspond to rpcPort -# The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh -prometheus: - enable: ${PROMETHEUS_ENABLE} - grafanaUrl: ${GRAFANA_URL} - apiPrometheusPort: [${API_PROM_PORT}] - userPrometheusPort: [ ${USER_PROM_PORT} ] - friendPrometheusPort: [ ${FRIEND_PROM_PORT} ] - messagePrometheusPort: [ ${MESSAGE_PROM_PORT} ] - messageGatewayPrometheusPort: [ ${MSG_GATEWAY_PROM_PORT} ] - groupPrometheusPort: [ ${GROUP_PROM_PORT} ] - authPrometheusPort: [ ${AUTH_PROM_PORT} ] - pushPrometheusPort: [ ${PUSH_PROM_PORT} ] - conversationPrometheusPort: [ ${CONVERSATION_PROM_PORT} ] - rtcPrometheusPort: [ ${RTC_PROM_PORT} ] - thirdPrometheusPort: [ ${THIRD_PROM_PORT} ] - messageTransferPrometheusPort: [ ${MSG_TRANSFER_PROM_PORT} ] # List of ports - -###################### LocalCache configuration information ###################### -# topic: redis subscriber channel -# slotNum: number of slots, multiple slots can prevent too many keys from competing for a lock -# slotSize: number of slots, the number of cached keys per slot, the overall cache quantity is slotNum * slotSize -# successExpire: successful cache time seconds -# failedExpire: failed cache time seconds -# disable local caching and annotate topic, slotNum, and slotSize -localCache: - user: - topic: DELETE_CACHE_USER - slotNum: 100 - slotSize: 2000 - successExpire: 300 - failedExpire: 5 - - group: - topic: DELETE_CACHE_GROUP - slotNum: 100 - slotSize: 2000 - successExpire: 300 - failedExpire: 5 - - friend: - topic: DELETE_CACHE_FRIEND - slotNum: 100 - slotSize: 2000 - successExpire: 300 - failedExpire: 5 - - conversation: - topic: DELETE_CACHE_CONVERSATION - slotNum: 100 - slotSize: 2000 - successExpire: 300 - failedExpire: 5 \ No newline at end of file diff --git a/deployments/templates/email.tmpl b/deployments/templates/email.tmpl deleted file mode 100644 index 0385601d00..0000000000 --- a/deployments/templates/email.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -{{ define "email.to.html" }} -{{ range .Alerts }} - -
-

OpenIM Alert

-

Alert Program: Prometheus Alert

-

Severity Level: {{ .Labels.severity }}

-

Alert Type: {{ .Labels.alertname }}

-

Affected Host: {{ .Labels.instance }}

-

Affected Service: {{ .Labels.job }}

-

Alert Subject: {{ .Annotations.summary }}

-

Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}

-
- -{{ end }} -{{ end }} diff --git a/deployments/templates/env-template.yaml b/deployments/templates/env-template.yaml deleted file mode 100644 index b019f97e5b..0000000000 --- a/deployments/templates/env-template.yaml +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2024 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ----------------------------------------------------------------------------- -# General Configuration -# This section contains general configuration options for the entire environment. -# These options can be set via environment variables. If both environment variables -# and settings in this .env file exist, the environment variables take precedence. -# ----------------------------------------------------------------------------- -# ========================== -# General Configuration -# ========================== -# These settings apply to the overall environment. - -# Data storage directory for persistent data. -# Example: DATA_DIR=/path/to/data -DATA_DIR=${DATA_DIR} - -# Docker image registry. Uncomment the preferred one. -# Options: ghcr.io/openimsdk, openim, registry.cn-hangzhou.aliyuncs.com/openimsdk -# IMAGE_REGISTRY="ghcr.io/openimsdk" -# IMAGE_REGISTRY="openim" -# IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk" -IMAGE_REGISTRY=${IMAGE_REGISTRY} - -# ====================================== -# ========= Network Configuration ====== -# ====================================== - -# Subnet for the Docker network. -# Default: DOCKER_BRIDGE_SUBNET=172.28.0.0/16 -DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET} - -# Set and specify the IP addresses of some containers. Generally speaking, -# you do not need to modify these configurations to facilitate debugging -DOCKER_BRIDGE_GATEWAY=${DOCKER_BRIDGE_GATEWAY} -MONGO_NETWORK_ADDRESS=${MONGO_NETWORK_ADDRESS} -REDIS_NETWORK_ADDRESS=${REDIS_NETWORK_ADDRESS} -KAFKA_NETWORK_ADDRESS=${KAFKA_NETWORK_ADDRESS} -ZOOKEEPER_NETWORK_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS} -MINIO_NETWORK_ADDRESS=${MINIO_NETWORK_ADDRESS} -OPENIM_WEB_NETWORK_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS} -OPENIM_SERVER_NETWORK_ADDRESS=${OPENIM_SERVER_NETWORK_ADDRESS} -OPENIM_CHAT_NETWORK_ADDRESS=${OPENIM_CHAT_NETWORK_ADDRESS} -PROMETHEUS_NETWORK_ADDRESS=${PROMETHEUS_NETWORK_ADDRESS} -GRAFANA_NETWORK_ADDRESS=${GRAFANA_NETWORK_ADDRESS} -NODE_EXPORTER_NETWORK_ADDRESS=${NODE_EXPORTER_NETWORK_ADDRESS} -OPENIM_ADMIN_FRONT_NETWORK_ADDRESS=${OPENIM_ADMIN_FRONT_NETWORK_ADDRESS} -ALERT_MANAGER_NETWORK_ADDRESS=${ALERT_MANAGER_NETWORK_ADDRESS} - -# ============================================================================== -# Configuration Update Instructions -# ============================================================================== -# This header outlines the methods to update common variables in config.yaml and .env files. -# These instructions are vital for maintaining the OpenIM environment's configuration. -# -# METHOD 1: Regenerate All Configurations -# ---------------------------------------- -# Use this method to regenerate all configurations. -# Steps: -# 1. Delete existing config files: -# - openim-server/config/config.yaml -# - openim-chat/config/config.yaml -# 2. Modify the .env file as required. -# 3. Run 'docker compose up -d'. This will regenerate: -# - config/config.yaml -# -# METHOD 2: Modify Individual Configuration Files -# ----------------------------------------------- -# Use this method to update specific configuration files. -# Steps: -# 1. Modify the .env file as necessary. -# 2. Update the corresponding entries in: -# - config/config.yaml -# 3. Restart the services with 'docker compose up -d'. -# 4. Special Note: If you modify OPENIM_IP, API_OPENIM_PORT, or MINIO_PORT in .env, -# ensure to update the corresponding services and configurations accordingly. -# -# It is essential to follow these methods to ensure consistent and correct application behavior. -# ============================================================================== -# Local IP address of the service. Modify if necessary. -# Example: OPENIM_IP=172.28.0.1, -OPENIM_IP=${OPENIM_IP} - -# ----- ZooKeeper Configuration ----- -# Port for ZooKeeper service. -# Default: ZOOKEEPER_PORT=12181 -ZOOKEEPER_PORT=${ZOOKEEPER_PORT} - -# MongoDB service port configuration. -# Default: MONGO_PORT=37017 -MONGO_PORT=${MONGO_PORT} - -# Password for MongoDB admin user. Used for service authentication. -# Default: MONGO_PASSWORD=openIM123 -MONGO_PASSWORD=${MONGO_PASSWORD} - -# Username for a regular OpenIM user in MongoDB. -# Default: MONGO_OPENIM_USERNAME=openIM -MONGO_OPENIM_USERNAME=${MONGO_OPENIM_USERNAME} - -# Password for a regular OpenIM user in MongoDB. -# Default: MONGO_OPENIM_PASSWORD=openIM123456 -MONGO_OPENIM_PASSWORD=${MONGO_OPENIM_PASSWORD} - -# Specifies the database name to be used within MongoDB. -# Default: MONGO_DATABASE=openim_v3 -MONGO_DATABASE=${MONGO_DATABASE} - -MONGO_MAX_POOL_SIZE=${MONGO_MAX_POOL_SIZE} -# ----- Redis Configuration ----- - -# Port on which Redis in-memory data structure store is running. -# Default: REDIS_PORT=16379 -REDIS_PORT=${REDIS_PORT} - -# Password to authenticate with the Redis service. -# Default: REDIS_PASSWORD=openIM123 -REDIS_PASSWORD=${REDIS_PASSWORD} - -# Kafka username to authenticate with the Kafka service. -# KAFKA_USERNAME=${KAFKA_USERNAME} - -# Port on which Kafka distributed streaming platform is running. -# Default: KAFKA_PORT=19092 -KAFKA_PORT=${KAFKA_PORT} - -# Topic in Kafka for storing the latest messages in Redis. -# Default: KAFKA_LATESTMSG_REDIS_TOPIC=latestMsgToRedis -KAFKA_LATESTMSG_REDIS_TOPIC=${KAFKA_LATESTMSG_REDIS_TOPIC} - -# MINIO_PORT -# ---------- -# MINIO_PORT sets the port for the MinIO object storage service. -# Upon changing this port, the MinIO endpoint URLs in the config/config.yaml file must be updated -# to reflect this change. The endpoints include both the 'endpoint' and 'signEndpoint' -# under the MinIO configuration. -# -# Default: MINIO_PORT=10005 -MINIO_PORT=${MINIO_PORT} - -# Access key to authenticate with the MinIO service. -# Default: MINIO_ACCESS_KEY=root -# MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} - -# Secret key corresponding to the access key for MinIO authentication. -# Default: MINIO_SECRET_KEY=openIM123 -MINIO_SECRET_KEY=${MINIO_SECRET_KEY} - -# ----- Prometheus Configuration ----- -# Port on which Prometheus service is running. -# Default: PROMETHEUS_PORT=19090 -PROMETHEUS_PORT=${PROMETHEUS_PORT} - -# ----- Grafana Configuration ----- -# Port on which Grafana service is running. -# Default: GRAFANA_PORT=13000 -GRAFANA_PORT=${GRAFANA_PORT} - -# ====================================== -# ============ OpenIM Web =============== -# ====================================== - -# Port on which OpenIM web service is running. -# Default: OPENIM_WEB_PORT=11001 -OPENIM_WEB_PORT=${OPENIM_WEB_PORT} - -# ====================================== -# ========= OpenIM Server ============== -# ====================================== -# Port for the OpenIM WebSockets. -# Default: OPENIM_WS_PORT=10001 -OPENIM_WS_PORT=${OPENIM_WS_PORT} - -# API_OPENIM_PORT -# --------------- -# This variable defines the port on which the OpenIM API service will listen. -# When changing this port, it's essential to update the apiURL in the config.yaml file -# to ensure the API service is accessible at the new port. -# -# Default: API_OPENIM_PORT=10002 -API_OPENIM_PORT=${API_OPENIM_PORT} - -# ====================================== -# ========== OpenIM Chat =============== -# ====================================== - -# Branch name for OpenIM chat. -# Default: CHAT_IMAGE_VERSION=main -CHAT_IMAGE_VERSION=${CHAT_IMAGE_VERSION} - -# Port for the OpenIM chat API. -# Default: OPENIM_CHAT_API_PORT=10008 -OPENIM_CHAT_API_PORT=${OPENIM_CHAT_API_PORT} - -# Port for the OpenIM admin API. -# Default: OPENIM_ADMIN_API_PORT=10009 -OPENIM_ADMIN_API_PORT=${OPENIM_ADMIN_API_PORT} - -# ====================================== -# ========== OpenIM Admin ============== -# ====================================== - -# Branch name for OpenIM server. -# Default: SERVER_IMAGE_VERSION=main -SERVER_IMAGE_VERSION=${SERVER_IMAGE_VERSION} - -# Port for the node exporter. -# Default: NODE_EXPORTER_PORT=19100 -NODE_EXPORTER_PORT=${NODE_EXPORTER_PORT} - -# Port for the prometheus. -# Default: PROMETHEUS_PORT=19090 -PROMETHEUS_PORT=${PROMETHEUS_PORT} - -# Port for the grafana. -# Default: GRAFANA_PORT=13000 -GRAFANA_PORT=${GRAFANA_PORT} - -# Port for the admin front. -# Default: OPENIM_ADMIN_FRONT_PORT=11002 -OPENIM_ADMIN_FRONT_PORT=${OPENIM_ADMIN_FRONT_PORT} - -# Port for the alertmanager. -# Default: ALERT_MANAGER_PORT=19093 -ALERT_MANAGER_PORT=${ALERT_MANAGER_PORT} diff --git a/deployments/templates/helm-image.yaml b/deployments/templates/helm-image.yaml deleted file mode 100644 index ef64abf91a..0000000000 --- a/deployments/templates/helm-image.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#This configuration file is used to override the use of the value.yaml variable. -#Currently, only the configuration with ingressName as nginx is provided. -#If it is another gateway such as istio or treafik, please modify the corresponding gateway requirements -image: - repository: ${IMAGE_REGISTRY}/openim-api - pullPolicy: Always - tag: "${SERVER_IMAGE_TAG}" -ingress: - enabled: true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - hosts: - - host: openim.server.com # your hostname - paths: - - path: /api(/|$)(.*) - pathType: ImplementationSpecific - tls: - - secretName: webapitls #your hostname tls - hosts: - - openim.server.com - -openim-msggateway: - image: - repository: ${IMAGE_REGISTRY}/openim-msggateway - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always - ingress: - enabled: true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - hosts: - - host: openim.server.com # your hostname - paths: - - path: /msg_gateway(/|$)(.*) - pathType: ImplementationSpecific - tls: - - secretName: webapitls #your hostname tls - hosts: - - openim.server.com - -openim-msgtransfer: - image: - repository: ${IMAGE_REGISTRY}/openim-msgtransfer - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-push: - image: - repository: ${IMAGE_REGISTRY}/openim-push - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-auth: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-auth - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-conversation: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-conversation - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-friend: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-friend - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-group: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-group - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-msg: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-msg - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-third: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-third - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always -openim-rpc-user: - image: - repository: ${IMAGE_REGISTRY}/openim-rpc-user - tag: "${SERVER_IMAGE_TAG}" - pullPolicy: Always \ No newline at end of file diff --git a/deployments/templates/instance-down-rules.yml b/deployments/templates/instance-down-rules.yml deleted file mode 100644 index 7a6e9fda9f..0000000000 --- a/deployments/templates/instance-down-rules.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -groups: - - name: instance_down - rules: - - alert: InstanceDown - expr: up == 0 - for: 1m - labels: - severity: critical - annotations: - summary: "Instance {{ $labels.instance }} down" - description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes." - - - name: database_insert_failure_alerts - rules: - - alert: DatabaseInsertFailed - expr: (increase(msg_insert_redis_failed_total[5m]) > 0) or (increase(msg_insert_mongo_failed_total[5m]) > 0) - for: 1m - labels: - severity: critical - annotations: - summary: "Increase in MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter detected" - description: "Either MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter has increased in the last 5 minutes, indicating failures in message insert operations to Redis or MongoDB,maybe the redis or mongodb is crash." diff --git a/deployments/templates/notification.yaml b/deployments/templates/notification.yaml deleted file mode 100644 index 665c212611..0000000000 --- a/deployments/templates/notification.yaml +++ /dev/null @@ -1,354 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Determines if a message should be sent. If set to false, it triggers a silent sync without a message. If true, it requires triggering a conversation. -# For rpc notification, send twice: once as a message and once as a notification. -# The options field 'isNotification' indicates if it's a notification. -groupCreated: - isSendMsg: true - -# Reliability level of the message sending. -# Set to 1 to send only when online, 2 for guaranteed delivery. - reliabilityLevel: 1 - -# This setting is effective only when 'isSendMsg' is true. -# It controls whether to count unread messages. - unreadCount: false - -# Configuration for offline push notifications. - offlinePush: - # Enables or disables offline push notifications. - enable: false - - # Title for the notification when a group is created. - title: "create group title" - - # Description for the notification. - desc: "create group desc" - - # Additional information for the notification. - ext: "create group ext" - -# Content type is not added here. -# Content should use a JSON structure conforming to the protobuf format. - -groupInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupInfoSet title" - desc: "groupInfoSet desc" - ext: "groupInfoSet ext" - - -joinGroupApplication: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "joinGroupApplication title" - desc: "joinGroupApplication desc" - ext: "joinGroupApplication ext" - -memberQuit: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "memberQuit title" - desc: "memberQuit desc" - ext: "memberQuit ext" - -groupApplicationAccepted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupApplicationAccepted title" - desc: "groupApplicationAccepted desc" - ext: "groupApplicationAccepted ext" - -groupApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: " title" - desc: " desc" - ext: " ext" - - -groupOwnerTransferred: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupOwnerTransferred title" - desc: "groupOwnerTransferred desc" - ext: "groupOwnerTransferred ext" - -memberKicked: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "memberKicked title" - desc: "memberKicked desc" - ext: "memberKicked ext" - -memberInvited: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "memberInvited title" - desc: "memberInvited desc" - ext: "memberInvited ext" - -memberEnter: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "memberEnter title" - desc: "memberEnter desc" - ext: "memberEnter ext" - -groupDismissed: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupDismissed title" - desc: "groupDismissed desc" - ext: "groupDismissed ext" - -groupMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupMuted title" - desc: "groupMuted desc" - ext: "groupMuted ext" - -groupCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupCancelMuted title" - desc: "groupCancelMuted desc" - ext: "groupCancelMuted ext" - defaultTips: - tips: "group Cancel Muted" - - -groupMemberMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupMemberMuted title" - desc: "groupMemberMuted desc" - ext: "groupMemberMuted ext" - -groupMemberCancelMuted: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupMemberCancelMuted title" - desc: "groupMemberCancelMuted desc" - ext: "groupMemberCancelMuted ext" - -groupMemberInfoSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupMemberInfoSet title" - desc: "groupMemberInfoSet desc" - ext: "groupMemberInfoSet ext" - -groupInfoSetAnnouncement: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupInfoSetAnnouncement title" - desc: "groupInfoSetAnnouncement desc" - ext: "groupInfoSetAnnouncement ext" - - -groupInfoSetName: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "groupInfoSetName title" - desc: "groupInfoSetName desc" - ext: "groupInfoSetName ext" - - -#############################friend################################# -friendApplicationAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "Somebody applies to add you as a friend" - desc: "Somebody applies to add you as a friend" - ext: "Somebody applies to add you as a friend" - -friendApplicationApproved: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "Someone applies to add your friend application" - desc: "Someone applies to add your friend application" - ext: "Someone applies to add your friend application" - -friendApplicationRejected: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "Someone rejected your friend application" - desc: "Someone rejected your friend application" - ext: "Someone rejected your friend application" - -friendAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "We have become friends" - desc: "We have become friends" - ext: "We have become friends" - -friendDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "deleted a friend" - desc: "deleted a friend" - ext: "deleted a friend" - -friendRemarkSet: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "Your friend's profile has been changed" - desc: "Your friend's profile has been changed" - ext: "Your friend's profile has been changed" - -blackAdded: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "blocked a user" - desc: "blocked a user" - ext: "blocked a user" - -blackDeleted: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "Remove a blocked user" - desc: "Remove a blocked user" - ext: "Remove a blocked user" - -friendInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "friend info updated" - desc: "friend info updated" - ext: "friend info updated" - -#####################user######################### -userInfoUpdated: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "Remove a blocked user" - desc: "Remove a blocked user" - ext: "Remove a blocked user" - -userStatusChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: false - title: "user status changed" - desc: "user status changed" - ext: "user status changed" - -#####################conversation######################### -conversationChanged: - isSendMsg: false - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "conversation changed" - desc: "conversation changed" - ext: "conversation changed" - -conversationSetPrivate: - isSendMsg: true - reliabilityLevel: 1 - unreadCount: false - offlinePush: - enable: true - title: "burn after reading" - desc: "burn after reading" - ext: "burn after reading" diff --git a/deployments/templates/openim-api.yaml b/deployments/templates/openim-api.yaml deleted file mode 100644 index 15fae592ce..0000000000 --- a/deployments/templates/openim-api.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: openim-api -description: "This is a description for openim-api" -type: "service" diff --git a/deployments/templates/openim.service b/deployments/templates/openim.service deleted file mode 100644 index 030e44c32c..0000000000 --- a/deployments/templates/openim.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=${SERVER_NAME} for OpenIM -Documentation=https://github.com/openimsdk/open-im-server/blob/main/deployment/README.md - -[Service] -WorkingDirectory=${OPENIM_DATA_DIR} -ExecStart=${OPENIM_INSTALL_DIR}/${SERVER_NAME} -c ${OPENIM_CONFIG_DIR} -Restart=always -RestartSec=5 -StartLimitInterval=0 - -[Install] -WantedBy=multi-user.target diff --git a/deployments/templates/openim.target b/deployments/templates/openim.target deleted file mode 100644 index 1d481ce31c..0000000000 --- a/deployments/templates/openim.target +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Unified target for OpenIM servers -Requires=openim-api.service openim-push.service openim-rpc-group.service openim-crontask.service openim-rpc-auth.service openim-rpc-msg.service openim-msggateway.service openim-rpc-conversation.service openim-rpc-third.service openim-msgtransfer.service openim-rpc-friend.service openim-rpc-user.service -After=openim-api.service openim-push.service openim-rpc-group.service openim-crontask.service openim-rpc-auth.service openim-rpc-msg.service openim-msggateway.service openim-rpc-conversation.service openim-rpc-third.service openim-msgtransfer.service openim-rpc-friend.service openim-rpc-user.service - -[Install] -WantedBy=multi-user.target diff --git a/deployments/templates/prometheus.yml b/deployments/templates/prometheus.yml deleted file mode 100644 index f1a551a623..0000000000 --- a/deployments/templates/prometheus.yml +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright © 2023 OpenIM. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# my global config -global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. - evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. - # scrape_timeout is set to the global default (10s). - -# Alertmanager configuration -alerting: - alertmanagers: - - static_configs: - - targets: ['${ALERT_MANAGER_ADDRESS}:${ALERT_MANAGER_PORT}'] - -# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. -rule_files: - - "instance-down-rules.yml" -# - "first_rules.yml" -# - "second_rules.yml" - -# A scrape configuration containing exactly one endpoint to scrape: -# Here it's Prometheus itself. -scrape_configs: - # The job name is added as a label "job='job_name'"" to any timeseries scraped from this config. - # Monitored information captured by prometheus - - job_name: 'node-exporter' - static_configs: - - targets: [ '${NODE_EXPORTER_ADDRESS}:${NODE_EXPORTER_PORT}' ] - labels: - namespace: 'default' - - # prometheus fetches application services - - job_name: 'openimserver-openim-api' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${API_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-msggateway' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${MSG_GATEWAY_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-msgtransfer' - static_configs: - - targets: [ ${MSG_TRANSFER_PROM_ADDRESS_PORT} ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-push' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${PUSH_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-auth' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${AUTH_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-conversation' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${CONVERSATION_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-friend' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${FRIEND_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-group' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${GROUP_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-msg' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${MESSAGE_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-third' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${THIRD_PROM_PORT}' ] - labels: - namespace: 'default' - - job_name: 'openimserver-openim-rpc-user' - static_configs: - - targets: [ '${DOCKER_BRIDGE_GATEWAY}:${USER_PROM_PORT}' ] - labels: - namespace: 'default'